First C Program

First C Program:

  1. First every c program must have one main() function.
  2. C program execution always start from main().
  3. Every statement ends with semicolon(;).

#include <stdio.h>

#include<conio.h>

void main()

{

printf(“Hello, world\n”);

getch();

}

#include <stdio.h> includes the standard input output library functions. The printf() function was defined in stdio.h file.

#include <conio.h> includes the console input output library functions. The getch() function is defined in conio.h file.

void main() The main() function is the entry point of every program in c language. The void keyword specifies that it returns no value.

printf() The printf() function is used to print data on the console.

getch() The getch() function asks for a single character. Until you press any key, it blocks the screen.

Compilation of C Program:  

By pressing ctlr+f9, the c program will compile.

To see the output alt+f5. (if you don’t give getch() function in the program).

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top