Home / Computer Science / C Language / First C Program

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).

 

About Santosh Kumar Gadagamma

I'm Santosh Gadagamma, an Experienced Software Engineer passionate about sharing knowledge in technologies like Java, C/C++, DBMS/RDBMS, Bootstrap, Big Data, Javascript, Android, Spring, Hibernate, Struts, and all levels of software design, development, deployment, and maintenance. I believe computers are essential for the world's functioning, and I'm committed to helping others learn the skills they need to succeed in tech. My website is a valuable learning tool to help you reach greater heights in your education and career, and I believe that education has no end points.

Check Also

Features of C language

WHERE is C Used Let us now see how does C compare with other programming …