In this post, I'm gonna share Hello, World! Program in C with you, in easy to understandable way. Write a c program to print Hello World in C.
In order to understand Hello, World! Program in C, you should have the knowledge of the following post:Different Parts of C ProgramHello, World! Program in C#include #include int main(){// printf() displays the string inside quotationprintf(“Hello, World!”);getch();return 0;}Output:Hello, World!How “Hello, World!” program works?The #include is a preprocessor directive that tells the compiler to include the contents of any header file like stdio.h (Standard Input Outout).stdio.h file contains functions such as scanf() and printf() to take input and display output respectively.The program will through an error, If you use the printf() function without using #include The execution of a C program starts with the main() function.printf() is a library function to send “String” to the console. In this program, printf() displays “Hello, World!” text on the screen.One more additional thing is getch() function, is basically a p redefine function of conio.h (console input output) header file, used to hold the screen until the user press any key.Basically what happen?, when the program get execute, after the whole execution it will automatically get exit. In order to avoid this, we have to use getch() or getche() function.The return 0; is the “Exit status” of the program. We can say that, the program ends with this statement.ConclusionIn this post I have shared the Hello, World! Program in C in easy to understandable manner.I hope you have got useful content from here. I have presented my best in front o you.Thanks for Visit!Original Credit: www.dheerajpatidar.com
Created: 08/22/2022
|
Visit site
Hide details
Tell a friend
Comments: 0
Enter comment
Report error
Link in a frame
Preview
|