1.What is the output?
enum colors {BLACK,BLUE,GREEN};
main(){
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);}
A.. 0..1..2
main(){
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);}
A.. 0..1..2
B. 1..2...3
C. Will not compile
A. Compilation error B.100 C.12
2. Predict the output
#define int char
main(){
int i=65;
printf("sizeof(i)=%d",sizeof(i));}
A. sizeof(i)=1
main(){
int i=65;
printf("sizeof(i)=%d",sizeof(i));}
A. sizeof(i)=1
B. sizeof(i)=65
C sizeof(i)=2
3. Judge the output
3. Judge the output
#define square(x) x*x
main(){
int i;
i = 64/square(4);
printf("%d",i);}
A..4 B.64
C.Compilation error
4. Does the following program generate error?
main(){
int i;
i = 64/square(4);
printf("%d",i);}
A..4 B.64
C.Compilation error
4. Does the following program generate error?
#include<stdio.h>
#define a 10
main(){
#define a 50
printf("%d",a);}
A. Yes B. No
#define a 10
main(){
#define a 50
printf("%d",a);}
A. Yes B. No
5.What is the output
#define f(g,g2) g##g2
main(){
int var12=100;
printf("%d",f(var,12));
}
main(){
int var12=100;
printf("%d",f(var,12));
}
A. Compilation error B.100 C.12
This site is very useful for us...
ReplyDeleteBy
S.Raja Ram BCA.