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 GSK

Hi, i am Santosh Gadagamma, a tutor in Software Engineering and an enthusiast for sharing knowledge in Computer Science and other domains. I developed this site to share knowledge to all the aspirants of technologies like, Java, C/C++, DBMS/RDBMS, Bootstrap, Big Data, Javascript, Android, Spring, Hibernate, Struts and all levels of software project design, development, deployment, and maintenance. As a programmer I believe that, "The world now needs computers to function." Hope, this site guides you as a learning tool towards greater heights. I believe that Education has no end points and i wish to learn more in the process of teaching you.

Check Also

Features of C language

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