Test-5 Answers

  1. What will be the output of the program?
      main(){
      if(1,0) printf("RISE");
      }
    Ans: No Output
  2. What will be the output of the program?
      int main(){
      int a=9,b=7,c=5;
      printf("%d %d %d");
      }
    Ans: Garbage value
  3. What will be the output of the program?
      int main(){
      float a;
      (int)a= 88;
      printf("%d",a);
      }
    Ans: Compiler Error
  4. What will be the output of the program?
      int main(){
      int a;
      a=sizeof(!3.14);
      printf("%d",a);
      }
    Ans: 4
  5. 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
  6. 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
  7. 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
  8. What will be the output of the program?
      int main(){
      int i=5;
      printf("%d" "%d" "%d",i,i<<=2,i>>=2);
      }
    Ans: 444
  9. 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
  10. 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