C Output Questions

  1. Find Error/Output in follwing code:
  2.                             
    void main ( )
    
    {
      char *P = "ayqm" ;
      char c;
      c = ++*p ;
      printf ("%c", c);
    }
    1. a
    2. 0x56FA
    3. m
    4. y
Answer :
A
Explanation:
Added By : Sumit

  1. Find Error/Output in follwing code:
  2.                             
    void main() 
    

      int x=10,*y,**z; 
      y=&x; 
      z=&y; 
      printf(\"%d%d%d\",*y,**z,*(*z)); 
    }
    1. 101010
    2. 100xaa54f10
    3. Run time error
    4. No Output
Answer :
A
Explanation:
Added By : Abhishek Mishra


  1. Find Error/Output in follwing code:
  2.                             
    void main()
    
    {
      int a = 1, b=2, c=3;
      char d = 0;
      if(a,b,c,d)
      {
        printf("EXAM");
      }
    }
    1. No Output and No Error
    2. EXAM
    3. Run time error
    4. Compile time error
Answer :
A
Explanation:
Print statement will not execute because if condition return false. Value of variable d is 0.
Added By : Amit Jain

  1. Find Error/Output in follwing code:
  2.                             
    void main()
    
    {
      int a = 1, b=2, c=3;
      if(a,b,c)
      {
        printf("EXAM");
      }
    }
    1. EXAM
    2. No Output
    3. Run time error
    4. None of the above
Answer :
A
Explanation:
Added By : Dheeraj Singh

  1. Find Error/Output in follwing code:
  2.                             
    void main()
    
    {
      printf("%d", printf("computer science"));
    }
    1. computer science16
    2. 16computer science
    3. computer science
    4. computer science18
Answer :
A
Explanation:
Added By : Dheeraj Singh

Social Sharing
Search