My First C language Program
Lets see the right way to write a easy c program
1 |
#embrace <stdio.h>#embrace <conio.h>int fundamental(){ printf(" C is a programming language"); getch();}</conio.h></stdio.h> |
Completely different components of C program.
- Pre-processor
- Header file
- Perform
- Variables
- expression
- Remark
All these are important components of a C language program.
Pre-processor
#embrace, the primary phrase of any C program. Additionally it is often called pre-processor. The principle work of pre-processor is to initialize the setting of program, i.e to hyperlink this system with the header file
Header file
Header file is a group of built-in features that assist us in our program. Header recordsdata comprise definitions of features and variables which might be included into any C program by pre-processor #embrace assertion. Normal header recordsdata are supplied with every compiler, and canopy a variety of areas like string dealing with, mathematical features, information conversion, printing and studying of variables.
To make use of any of the usual features, the suitable header file should be included. That is accomplished at first of the C source file.
For instance, to make use of the printf() perform in a program, the road #embrace
fundamental() perform
fundamental() perform is a perform that should be utilized in each C program. A perform is a sequence of assertion required to carry out a particular job. fundamental() perform begins the execution of C program. Within the above instance, int in entrance of fundamental() perform is the return kind of fundamental() perform. we’ll focus on about it intimately later. The curly braces { }
simply after the fundamental() perform encloses the physique of fundamental() perform.
1 |
#embrace <stdio.h>#embrace <conio.h>void fundamental(){ printf("Howdy,World"); getch();}</conio.h></stdio.h> |
#embrace
#embrace
void fundamental() The fundamental() perform is the entry level of each program in c language. The void key phrase specifies that it returns no worth.
printf() The printf() perform is used to print information on the console.
getch() The getch() perform asks for a single character. Till you press any key, it blocks the display screen.