+ 1
why Console.Read() giving wrong output in following when used instead of Console.ReadLine()
{ static void Main(string[] args) {Console .WriteLine("count to: "); int x= Convert.ToInt32(Console.ReadLine()); for(int i=0; i<=x; i++) {Console .WriteLine(i); } } }
3 Antworten
0
this code has been posted by someone else in a question, i just posted it with some changes to ask different question.
0
Console.Read() only reads the first character that's you write in the console
0
but then for one digit no. output should be same, but in above case it is not