
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the Standard Input and Output Stream through Console in C#?
To get the standard input stream through Console, the code is as follows −
Example
using System; public class Demo { public static void Main(string[] args){ Console.WriteLine("Displaying standard input stream..."); Console.WriteLine("Standard Input Stream = "+Console.In); } }
Output
This will produce the following output −
Displaying standard input stream... Standard Input Stream = System.IO.TextReader+SyncTextReader
Example
Let us now see an example to display standard output stream −
using System; public class Demo { public static void Main(string[] args){ Console.WriteLine("Displaying standard output stream..."); Console.WriteLine("Standard Output Stream = "+Console.Out); } }
Output
This will produce the following output −
Displaying standard output stream... Standard Output Stream = System.IO.TextWriter+SyncTextWriter
- Related Questions & Answers
- Getting the Standard Output and Standard Error Output Stream through Console in C#
- Standard Input Stream (cin) in C++
- What is C++ Standard Output Stream (cout)?
- Check if Input, Output and Error is redirected on the Console or not in C#
- How to play Beep sound through Console in C#?
- How to change the Output Encoding Scheme of the C# Console?
- What is C++ Standard Error Stream (cerr)?
- How to change the Input Encoding Scheme of the C# Console?
- Get number from user input and display in console with JavaScript
- How to play user modified Beep sound through Console in C#?
- Basic Input/Output in C++
- Way to read input from console in C#
- How to flush output stream after writing bytes
- What are the input and output for strings in C language?
- Explain unformatted input and output functions in C language
Advertisements