Console.Read() Method in C# Last Updated : 28 Feb, 2019 Comments Improve Suggest changes Like Article Like Report Console.Read() Method is used to read the next character from the standard input stream. This method basically blocks its return when the user types some input characters. As soon as the user press ENTER key it terminates. Syntax: public static int Read (); Return Value: It returns the next character from the input stream, or a negative one (-1) if there are currently no more characters to be read. Exception: This method will give IOException if an I/O error occurred. Below programs illustrate the use of above-discussed method: Example 1: csharp // C# program to illustrate the use // of Console.Read Method using System; namespace GFG { class Program { static void Main(string[] args) { int x; Console.WriteLine("Enter your Character to get Decimal number"); // using the method x = Console.Read(); Console.WriteLine(x); } } } Output: Example 2: csharp // C# program to illustrate the use // of Console.Read Method using System; namespace GFG { class Program { static void Main(string[] args) { // Write to console window. int x; Console.WriteLine("Enter your Character to get Decimal number"); x = Console.Read(); Console.WriteLine(x); // Converting the decimal into character. Console.WriteLine(Convert.ToChar(x)); } } } Output: Reference: https://docs.microsoft.com/en-us/dotnet/api/system.console.read?view=netframework-4.7.2 Comment More infoAdvertise with us Next Article Console.Read() Method in C# S Sabya_Samadder Follow Improve Article Tags : C# CSharp-method CSharp-Console-Class Similar Reads Console.ReadKey() Method in C# Console.ReadKey() Method makes the program wait for a key press and it prevents the screen until a key is pressed. In short, it obtains the next character or any key pressed by the user. The pressed key is displayed in the console window(if any input process will happen). There are two methods in th 5 min read Console.ReadLine() Method in C# This method is used to read the next line of characters from the standard input stream. It comes under the Console class(System Namespace). If the standard input device is the keyboard, the ReadLine method blocks until the user presses the Enter key. And if standard input is redirected to a file, th 2 min read Console.SetIn() Method in C# The Console.SetIn() method is used to set the In property of the specified StreamReader object i.e. it redirects the standard input from the console to the input file. Since the console is set with this StreamReader object, the ReadLine() method can be called to read the contents of the file, line b 2 min read Console.SetOut() Method in C# Console.SetOut(TextWriter) Method in C# is used to redirect the stream of standard output. With the help of this method, a user can specify a StreamWriter as the output object. The Console.SetOut method will receive an object of type TextWriter. The StreamWriter can be passed to Console.SetOut and i 2 min read Console.Clear Method in C# This method is used to clear the console buffer and corresponding console window of display information. Syntax: public static void Clear (); Exceptions: This method throws IOException if an I/O error occurred. Below programs show the use of Console.Clear() method: Program 1: To display the contents 1 min read Like