Managing Console Input Output Operations in C#

Console Class:

The methods for reading from and writing to the console are provided by the System.Console class. This class gives us access to the standard input and standard output.

Console Input:

The console input stream object supports two methods for obtaining input from the keyboard.
1. Read(): It returns a single character as int.

int p=Console.Read();

2. ReadLine(): It returns a string containing a line of text.

string sk=Console.ReadLine();

Console Output:

The console output stream supports two methods for writing to the console:
1. Write(): Outputs one or more values to the screen without a newline character.
2. WriteLine(): Outputs one or more values to the screen but adds a new line character at the end of the output.