- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Console.Read() Method in C#
The Console.Read() method in C# is used to read the next character from the standard input stream.
Syntax
The syntax is as follows −
public static int Read ();
Example
Let us now see an example to implement the Console.Read() method in C# −
using System; public class Demo{ public static void Main(){ int val; Console.WriteLine("Enter a value"); val = Console.Read(); Console.WriteLine("Entered value: "+val); } }
Output
This will produce the following output. Let’s say
Enter a value Entered value: 53
Advertisements
To Continue Learning Please Login
Login with Google