Hello World Program In C Language

This is the very first program which almost every person learn and make when they start learning any programming language.It is a very basic program and it basically prints only "Hello,World!" on a screen.

Here is the simple code for Hello World program

#include<stdio.h>

int main()

{ printf("Hello, World!");
   
 getch();
}

👉Here i am using codeblocks software so i have written some different things such as i have used getch(); statement because i am using codeblocks software you can also use return0; instead of getch();

Working of Hello world program!

  • The #include is a preprocessor command which tells the compiler to include the contents of <stdio.h> (standard input and output) file in the program.
  • The <stdio.h> file contains functions such as printf() to display out or print the message on the screen.
  • If you use the printf() function without writing #include<stdio.h> the program may not compile but in codeblocks software it will be compiled and it will run also.
  • The execution of program starts from main() function.
  • The program ends with return0; or getch(); 

Here are some screenshots of the program.







No comments:

Post a Comment