Test-5 Answers
- What will be the output of the program?
main(){
if(1,0) printf("RISE");
}
Ans: No Output
- What will be the output of the program?
int main(){
int a=9,b=7,c=5;
printf("%d %d %d");
}
Ans: Garbage value
- What will be the output of the program?
int main(){
float a;
(int)a= 88;
printf("%d",a);
}
Ans: Compiler Error
- What will be the output of the program?
int main(){
int a;
a=sizeof(!3.14);
printf("%d",a);
}
Ans: 4
- What will be the output of the program?
int main(){
int x=10,y;
y=(x++, printf("%d ",x),++x,printf("%d ",x),x++);
printf("%d ",y);
printf("%d",x);
}
Ans: 11 12 12 13
- What will be the output of the program?
int main(){
int a=2,b=2,c=10;
c=c!=a==b;
printf("%d",c);
}
Ans: 0
- What will be the output of the program?
int main(){
int i=2;
switch(i){
case 1:printf("RISE");
break;
case 2:continue;
printf("Code");
case 3:printf("Test");
break;
}
}
Ans: Compiler Error
- What will be the output of the program?
int main(){
int i=5;
printf("%d" "%d" "%d",i,i<<=2,i>>=2);
}
Ans: 444
- What will be the output of the program?
int main(){
int i=3;
int l=i/-2;
int k=i%-2;
printf("%d %d",l,k);
}
Ans: -1 1
- What will be the output of the program?
int main(){
int x=1,y=0,z=3;
x>y?printf("%d",z):return z;
}
Ans: Compiler Erroe