+ 3

What i have to write before? * = Console.ReadLine(); *

Fill in the blanks to ask for user input in the method and return the value entered using output parameters. static void Ask( out string name) { = Console.ReadLine(); } static void Main(string[] args) { string nm; Ask( out nm); }

26th Feb 2018, 6:31 PM
Zahid Farook
Zahid Farook - avatar
5 odpowiedzi
+ 1
static void Ask(out string name) { name = Console.ReadLine(); } You don't return anything. The out parameter acts similar to a pointer, meaning that if you modify an out variable in your method, the change will persist since you modified the out variable you overloaded directly.
27th Feb 2018, 7:00 AM
Kai Schlegel
Kai Schlegel - avatar
0
out name out
8th Feb 2021, 9:25 AM
Brinsley Demenezes
Brinsley Demenezes - avatar
0
Fill in the blank to define a method that does not return a value. static Register(string name, string mail) { //some code }
31st Jul 2023, 8:14 AM
Collins Abasi
Collins Abasi - avatar
0
Rearrange the code to declare a method that returns the square of its argument.
31st Jul 2023, 8:16 AM
Collins Abasi
Collins Abasi - avatar
0
Rearrange the code to declare a method that returns the square of its argument.
31st Jul 2023, 8:16 AM
Collins Abasi
Collins Abasi - avatar