2 - Reading and Writing to console in c# | Input and Output to Console in c# visual studio
Programming Guru
If you have just started learning C#, you might be interested to know, how we can read or write to console app using C#, in this article, I have explained it with an example.
Writing in Console App
In C# you can write or print to console using Console.WriteLine() or Console.Write(), basically both methods are used to print output of console.
Only difference between Console.WriteLine() and Console.Write() is that, Console.WriteLine() also makes control move to the next line while Console.Write() keeps the Control in same line.
Reading in Console App
When we want to read user’s data in C# in Console application, we can use Console.Readline() or Console.Read() method of C#.
Basically, the difference between Console.ReadLine() and Console.Read() is
Console.Read: Reads the next character from the standard input stream.
Console.ReadLine: Reads the next line of characters from the standard input stream.
You can understand it as, Console.Read()reads a character, so if you are on a console and you press a key then the console will close, but when using Console.Readline() it will read the whole string.
Reading and Writing to console in c# | Input and Output to Console in c# visual studio Reading and Writing to console in c# | Input and Output to Console in c# visual studio Reading and Writing to console in c# | Input and Output to Console in c# visual studio Reading and Writing to console in c# | Input and Output to Console in c# visual studio Reading and Writing to console in c# | Input and Output to Console in c# visual studio
How to Write to console in C#,writing to Console in C# Visual Studio,Writiing Text To Console in C#,How to write text to console in C# visual studio,writing to console,writing to console in C#,How to read from Console in C#,Reading from Console in C#,Reading Text From console,Reading and Writing To Console in C#,writing in console,Reading and Writing to console in c#,Input and Output to Console in c# visual studio,input output to console,c# tutorial for beginners ... https://www.youtube.com/watch?v=XnAu8css7Ck
17311337 Bytes