0
What does "Result: {0}" mean in the code?
do { Console.Write("x = "); int x = Convert.ToInt32(Console.ReadLine()); Console.Write("y = "); int y = Convert.ToInt32(Console.ReadLine()); int sum = x+y; Console.WriteLine("Result: {0}", sum); } while(true);
2 ответов
+ 3
{0} acts like a placeholder and will be replaced by the given value which in your code is sum
if no value provided it will act like a normal string
+ 1
Thanks