C Output Questions

  1. Find Error/Output in follwing code:
  2.                             
    How many times "Placement Question" will print.
    
    int main() 
    {
      int x;
      for(x=-1; x<=10; x++)
      {
        if(x < 5)
          continue;
        else
          break;
        printf("Placement Question");
      } 
      return 0;
    }
    1. Infinite Time
    2. 11 Times
    3. 0 Time
    4. 10 Times
Answer :
C
Explanation:
Added By : Nikhil

  1. Find Error/Output in follwing code:
  2.                             
    int main()  
    
    {
      printf("%d%d%d", sizeof(3.14f), sizeof(3.14l));
    }
    1. 4160
    2. 844
    3. 3284
    4. None of the above
Answer :
A
Explanation:
Added By : Satyam


  1. Find Error/Output in follwing code:
  2.                             
    int main()
    
    {
      int a = 10, b = 25;
      a = b++ + a++;
      b = ++b + ++a;
      printf("%d %d n", a, b);
    1. 36 64
    2. 35 62
    3. 36 63
    4. 30 28
Answer :
C
Explanation:
Added By : Abhinav

  1. Find Error/Output in follwing code:
  2.                             
    int main()
    
    {
      char arr[7]="Network";
      printf("%s", arr);
      return 0; 
    }
    1. Network
    2. N
    3. Garbage value
    4. Compilation error
Answer :
A
Explanation:
Added By : Shubham

  1. Find Error/Output in follwing code:
  2.                             
    int main()
    
    {
      int x = 7538;
      printf("%d %dn", x % 100, x / 10);
    }
    1. 38 753
    2. 75 538
    3. 538 38
    4. 0 753
Answer :
A
Explanation:
Added By : Shashank

  1. Find Error/Output in follwing code:
  2.                             
    int main ()
    
    {
      int x = 20, y = 35;
      x = y++ + x++;
      y = ++y + ++x;
      printf ("%d %d n", x, y);
    }
    1. 55 92
    2. 56 93
    3. 57 94
    4. None of the above
Answer :
B
Explanation:
Added By : Nikhil


  1. Find Error/Output in follwing code:
  2.                             
    void fn()
    
    {
      static int i = 10;
      printf("%d ", ++i);
    }
    int main()
    {
      fn();
      fn();
    }
    1. 10 10
    2. 11 11
    3. 11 12
    4. 12 12
Answer :
C
Explanation:
Added By : Rajiv

  1. Find Error/Output in follwing code:
  2.                             
    int main ()
    
    {
      int x = 24, y = 39, z = 45;
      z = x + y;
      y = z - y;
      x = z - y;
      printf ("n%d %d %d", x, y, z);
    }
    1. 24 39 63
    2. 39 24 63
    3. 24 39 45
    4. 39 24 45
Answer :
B
Explanation:
Added By : Akhil

Post Your Question
Social Sharing
Search