fig: pre-processor |
Pre-processor is a program that processes its input data to produce output that is used as input to another program, which will pre-process our source code, for that we will use preprocessor directives to pre-processor. Pre-processor are started with the # symbol. We don’t need to use a semicolon in the pre-processor.
Syntax
#include < stdio.h >
They are used before the complication of a program, so they are written at the top of the program.
#include this will specify the name of the file to enter.
#define this will define a macro
#undefine this will undefine the macro
#if
#else
#end if etc. are the example of pre-processor.
Pre-processor can be category in 3 parts they are:-
1) macro substitution
2) file inclusion
3) compiler control
First program
#include < stdio.h > , #include < conio.h> They are a library file to run a program.<stdio.h> includes input-output and printf function. where <conio.h> include Clrscr () ( is used to clear the screen ) and getch () (is used to hold the answer for a while on the screen.) in this program, we are not defining any variable so we have only the executable part which we have shown below.
0 Comments