31. C preprocessor
32. A preprocessor command
33. What will be the output of the program?
#include<stdio.h>
#define int char
void main()
{
int i = 65;
printf("sizeof(i)=%d", sizeof(i));
}
#include<stdio.h>
#define int char
void main()
{
int i = 65;
printf("sizeof(i)=%d", sizeof(i));
}
34. What will be the output of the following program?
#include<stdio.h>
#define square(x) x*x
void main()
{
int i;
i = 64/square(4);
printf("%d", i);
}
#include<stdio.h>
#define square(x) x*x
void main()
{
int i;
i = 64/square(4);
printf("%d", i);
}
35. What will be the output of the program code?
#include<stdio.h>
#define a 10
void main()
{
#define a 50
printf("%d", a);
}
#include<stdio.h>
#define a 10
void main()
{
#define a 50
printf("%d", a);
}
36. Choose the correct statement.
I. The scope of a macro definition need not be the entire program.
II. The scope of a macro definition extends from the point of definition to the end of the file.
III. New line is a macro definition delimiter.
IV. A macro definition may go beyond a line.
I. The scope of a macro definition need not be the entire program.
II. The scope of a macro definition extends from the point of definition to the end of the file.
III. New line is a macro definition delimiter.
IV. A macro definition may go beyond a line.
37. Determine output:
#include<stdio.h>
#define clrscr() 100
void main()
{
clrscr();
printf("%dn", clrscr());
}
#include<stdio.h>
#define clrscr() 100
void main()
{
clrscr();
printf("%dn", clrscr());
}
38. What will be the output of the following program?
#include<stdio.h>
#define prod(a,b) a*b
void main()
{
int x=3,y=4;
printf("%d", prod(x+2,y-1));
}
#include<stdio.h>
#define prod(a,b) a*b
void main()
{
int x=3,y=4;
printf("%d", prod(x+2,y-1));
}
39. In which stage the following code
#include<stdio.h>
gets replaced by the contents of the file stdio.h
#include<stdio.h>
gets replaced by the contents of the file stdio.h
40. What will be output if you will compile and execute the following c code?
#include<stdio.h>
#define max 5
void main(){
int i = 0;
i = max++;
printf("%d", i++);
}
#include<stdio.h>
#define max 5
void main(){
int i = 0;
i = max++;
printf("%d", i++);
}