What is the difference between Console.ReadLine(); and Console.Read(); | SoloLearn: Learn to code for FREE!

0

What is the difference between Console.ReadLine(); and Console.Read();

7/13/2016 12:03:29 PM

chaitanya guruprasad

3 Answers

New Answer

+6

Console.WriteLine("your text"); writes your text and goes to new line, while Console.Write("your text") would stay in the same line, eg: for(int i=0; i < 5; i++) { Console.WriteLine(i); } gives: 0 1 2 3 4 While: for (int i = 0; i < 5; i++) { Console.Write(i); } gives: 01234

+2

Console.ReadLine() returns everything you typed in the console, while Console.Read() inly the first character

0

is the same explanation valid for Console.WriteLine() and Console.Write()?