In C#, to take input from the standard input device, the following method are used – Console.Read() and Console.ReadLine() method. Console is a predefined class of System namespace. While Read() and ReadLine() both are the Console Class methods.
The only difference between the Read() and ReadLine() is that Console.Read is used to read only single character from the standard output device, while Console.ReadLine is used to read a line or string from the standard output device.
Program 1: Example of Console.Read() in C#.
Program 2: Example of Console.ReadLine() in C#.
Geeks For Geeks
In the above code, program 1 shows that it will read only single character and program 2 shows it will read string until new line character is not found.
- Difference between 4NF and 5NF
- Difference between ELT and ETL
- Difference between LAN and MAN
- Difference between DML and TCL
- Web 1.0, Web 2.0 and Web 3.0 with their difference
- Difference Between Gi-Fi and Li-Fi
- Difference between H.323 and SIP
- Difference between RPC and RMI
- Difference Between SMO and SEO
- Difference between PNG and GIF
- Difference between IoT and M2M
- Difference between LAN, MAN and WAN
- What is the difference between GUI and CUI?
- Difference between CD and DVD
- Difference between DFD and ERD
- Difference between DFA and NFA
- Difference between LAN and WAN
- Difference between T-SQL and PL-SQL
- Difference Between GIT and SVN
- Difference between BFS and DFS
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.