C# program to print a message without using the WriteLine() method
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to print a message without using the WriteLine() method is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created a class Sample that contains the Main() method. In the Main() method, we created a string str initialized with "India".
In the above statement, we converted the string into a byte array.
In the above statements, we created the object of Stream class and then write converted byte array on the standard output device that is "Monitor", that's why the message "India" will be printed on the console screen.