How to print Hello World in c languages|C program to print Hello world

c program to print hello world

How to print Hello World in c languages

Hello, World!” program. It’s the first program many of us learn when we start programming. for I am here to guide you through the process of writing your very own “Hello, World!” program in C.

we’ll need to include the standard input/output header file, “stdio.h”. This will allow us to use the “printf” function to print our message to the console.

Program

//Program To print " Hello World"

#include<stdio.h>
#include<conio.h>

void main() 
{ 
 clrscr();        //Devc++ compiler does not use clrscr .
 printf("Hello World");
 getch();
}

Output

Hello World


You can also print your name or the name of any city, address, or message at the place of hello world, you can see the example given below.

Program To print “Sirf Padhai”

//Program To print "Sirf Padhai"

#include<stdio.h>
#include<conio.h>

void main() 
{ 
 clrsr();          //Devc++ compiler does not use clrscr .
 printf("Sirf Padhai");
 getch();
}

Output

Sirf Padhai

Program To print “Massaging”

//Program To print "What did you learn from Sirf Padhai and tell me by commenting?"
#include<stdio.h>
#include<conio.h>

void main() 
{ 
 clrsr();      //Devc++ compiler does not use clrscr .
 printf("What did you learn from Sirf Padhai and tell me by commenting?");
 getch();
}

Output

What did you learn from Sirf Padhai and tell me by commenting?

Our program’s starting point is the “int main()” function. We are printing our message to the console within this function by utilizing the “printf” function. After printing the message, the “n” at the end of the message—a newline character—will move the pointer to the next line.

“Return 0” is being used to end the program. Although it is not required, it is a good idea to include it to show that our program has been successfully run.

With the source code in hand, you can now compile and run the program to witness the magic. So, go ahead and compile it using your preferred C compiler and see how effective “Hello World!” is.

Remember that this is only the starting point.

You can also read c language tutorial in Hindi, I hope you have come well to print hello in c program, if you have any problem then you can ask on telegram or instagram. 

Thank You.
Previous articlePython Text Manipulation(Splitting)|Python text manipulation tutorial
Next articleMultiple inheritance in C++ example | Multiple Inheritance Example| what is multiple inheritance ?

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here