C# Program to Print Hello World Without using WriteLine


This is a C# Program to print hello world without using writeLine.

Problem Description

This C# Program Prints Hello World Without using WriteLine.

Problem Solution

Here the text is printed without using any writeline functions.

Program/Source Code

Here is source code of the C# Program to Print Hello World Without using WriteLine. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.

 * C# Program to Print Hello World Without using WriteLine
using System;
class Program
    static void Main(string[] args)
        if (System.Console.OpenStandardOutput().BeginWrite(new byte[] { 072, 101, 
            108, 108, 111, 032, 087, 111, 114, 108, 100, 0 },0, 
            12, null, null).AsyncWaitHandle.WaitOne()) 
        if (System.Console.ReadKey().Modifiers == 0) 
Program Explanation

In this C# Program the Console.OpenStandardOutput Method() is used to Acquires the standard output stream. The Console.ReadKey() method is used to obtain the next character or function key pressed by the user. The pressed key is displayed in the console window. The BeginWrite() method is used to begin an asynchronous write operation. Then print the text without using any writeline functions.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
Runtime Test Cases
Hello World

Sanfoundry Global Education & Learning Series – 1000 C# Programs.

If you wish to look at all C# Programming examples, go to 1000 C# Programs.

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.