My First C language Program

Posted on

My First C language Program

 

Lets see easy methods to write a easy c program


Completely different components of C program.

 

  • Pre-processor
  • Header file
  • Operate
  • Variables
  • expression
  • Remark

All these are important components of a C language program.


Pre-processor

#embody, the primary phrase of any C program. Additionally it is often known as pre-processor. The principle work of pre-processor is to initialize the atmosphere of program, i.e to hyperlink this system with the header file .


Header file

Header file is a set of built-in features that assist us in our program. Header information include definitions of features and variables which might be integrated into any C program by pre-processor #embody assertion. Customary header information are supplied with every compiler, and canopy a variety of areas like string dealing with, mathematical features, knowledge conversion, printing and studying of variables.

To make use of any of the usual features, the suitable header file have to be included. That is performed at first of the C source file.

For instance, to make use of the printf() operate in a program, the road #embody is accountable.


essential() operate

essential() operate is a operate that have to be utilized in each C program. A operate is a sequence of assertion required to carry out a selected job. essential() operate begins the execution of C program. Within the above instance, int in entrance of essential() operate is the return sort of essential() operate. we are going to focus on about it intimately later. The curly braces { } simply after the essential() operate encloses the physique of essential() operate.


 

#embody contains the normal enter output library features. The printf() operate is outlined in stdio.h .

#embody contains the console enter output library features. The getch() operate is outlined in conio.h file.

void essential() The essential() operate is the entry level of each program in c language. The void key phrase specifies that it returns no worth.

printf() The printf() operate is used to print knowledge on the console.

getch() The getch() operate asks for a single character. Till you press any key, it blocks the display screen.