+ 2
c#::::::question in printing text
why an error is occurred when Console.WriteLine("x = {0}",x);and Console.WriteLine("y = {1}",y); statements are written in two different lines
3 Antworten
+ 13
use it:
Console.Write();
+ 2
Console. WriteLine ("y={1}",y);
This is a new statement. It does know about the x-statement. Placeholders always should start with 0.
So it must be
Console.WriteLine ("y={0}",y);
Although placeholders do not have to follow a specific order.
Console.WriteLine ("{1}{0}",x,y);
https://code.sololearn.com/c9Sy3XspIEZB/?ref=app
+ 1
The correct way is this
https://code.sololearn.com/c3VDHBww2kAg/?ref=app