(1)What is preprocessor ?
Ans:
All the preprocessor are not part of c program. It is only instruction to compiler. All the preprocessor process before the staring of actual compilation and create an intermediate file. In the intermediate file all preprocessor is converted in term of actual c.
To see the intermediate file :
Step 1: First create any c file let us assume test. c which contain :
#define max 10+2
void main()
{
int a;
a=max*max;
printf(“%d”,a);
}
Step 2: go to command mode. Open run then write cmd then press enter.
Step 3: Go to the directory where test .c has been created.
Step 4: write in the command mode
cpp test. c and press enter key (to create intermediate file)
Ans:
All the preprocessor are not part of c program. It is only instruction to compiler. All the preprocessor process before the staring of actual compilation and create an intermediate file. In the intermediate file all preprocessor is converted in term of actual c.
To see the intermediate file :
Step 1: First create any c file let us assume test. c which contain :
#define max 10+2
void main()
{
int a;
a=max*max;
printf(“%d”,a);
}
Step 2: go to command mode. Open run then write cmd then press enter.
Step 3: Go to the directory where test .c has been created.
Step 4: write in the command mode
cpp test. c and press enter key (to create intermediate file)
Step 5: type test. i (to see the intermediate file )
(2) Why preprocessor ?
Ans :
1. It improves the readability of program.
2. It makes easy to modify
3. portability
(3) List all preprocessor directives.
Ans:
2. It makes easy to modify
3. portability
(3) List all preprocessor directives.
Ans:
0 comments:
Post a Comment