Unc
Unc
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Okay 👍
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Oh, so the return, by itself, does it. Okay.
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
And number would only equal 5 if we put “return DisplayIfNecessary(5);” Correct?
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Number would equal to 5?
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
If we wrote DisplayIfNecessary(5)
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Console.WriteLine("First call:"); DisplayIfNecessary(6); Console.WriteLine("Second call:"); DisplayIfNecessary(5); void DisplayIfNecessary(int number) { if (number % 2 == 0) { return; } Console.WriteLine(number); }
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Last question on return
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
My bad
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Ik I meant like the method in general
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
So the public static sets 56 and 887 as number1 and number2
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Yeah
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Ik but in this example
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
So 56 and 887
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
In this example how could it return number1 and number2 when they aren’t numbers
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Right?
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
And void means u aren’t returning anything
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Oh
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
What is it returning?
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
Console.WriteLine("First call:"); DisplayIfNecessary(6); Console.WriteLine("Second call:"); DisplayIfNecessary(5); void DisplayIfNecessary(int number) { if (number % 2 == 0) { return; } Console.WriteLine(number); }
55 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
I searched Google and they say that it returns a value but I can’t find examples
55 replies