My First C language Program
Lets see easy methods to write a easy c program
1 |
#embody <stdio.h>#embody <conio.h>int essential(){ printf(" C is a programming language"); getch();}</conio.h></stdio.h> |
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
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.
1 |
#embody <stdio.h>#embody <conio.h>void essential(){ printf("Hey,World"); getch();}</conio.h></stdio.h> |
#embody
#embody
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.