0

where am I mistake?

namespace Restart { class Program { static void Main(string[] args) { int num; int age; TestMethod(out num, out age); Console.WriteLine(num,age); Console.ReadKey(); } static void TestMethod(out int x, out int y) { x = 12; y = 2; } } }

9th Jul 2017, 8:29 AM
Raffi Ohannesian
Raffi Ohannesian - avatar
2 ответов
+ 3
Also you can use it in this syntax: Console.WriteLine (String , Object) where the String is used as format.e.g. int Age = 35; String Name ="John Doe"; Console.WriteLine("Your name is {0} and you are {1} years old", Name, Age); The {0} and {1} represents index of arguments following the format string.
9th Jul 2017, 8:54 AM
Ipang
0
the first thing to do is using "toString()" method on num variable (the same with age), when you write: Console.WriteLine(num,age); and also put a + sign instead of come, here is correction: Console.WriteLine(num.toString() + " " + age.toString()); or you could write like that: Console.WriteLine(num.toString()); Console.WriteLine(age.toString());
9th Jul 2017, 8:41 AM
2_3rr0r5
2_3rr0r5 - avatar