Home / C Programming / Expressions :: Find Output of Program

C Programming :: Expressions

  1. What will be the output of the program?

    #include
     int main() 
     {   
          int x=55;  
          printf("%d, %d, %d\n", x55, x=40, x>=10);     
          return 0;
     }
    

  2. A.

    1, 40, 1

    B.

    1, 55, 1

    C.

    1, 55, 0

    D.

    1, 1, 1

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What will be the output of the program?

    #include
     int main() 
     {
         int i=2; 
         printf("%d, %d\n", ++i, ++i);   
         return 0; 
    } 
    

  4. A.

    3, 4

    B.

    4, 3

    C.

    4, 4

    D.

    Output may vary from compiler to compiler

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. What will be the output of the program?

    #include
     int main() 
     {   
         int k, num=30;    
         k = (num>5 ? (num 10 ? 100 : 200): 500);   
         printf("%d\n", num);    
         return 0; 
     } 
    

  6. A.

    200

    B.

    30

    C.

    100

    D.

    500

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. What will be the output of the program?

    #include
     int main() 
     {   
      char ch;    
      ch = 'A';    
      printf("The letter is");    
      printf("%c", ch >= 'A' && ch 'Z' ? ch + 'a' - 'A':ch); 
      printf("Now the letter is");     
      printf("%c\n", ch >= 'A' && ch 'Z' ? ch : ch + 'a' - 'A'); 
      return 0;
     }
    

  8. A.

    The letter is a
    Now the letter is A

    B.

    The letter is A
    Now the letter is a

    C.

    Error

    D.

    None of above

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. What will be the output of the program?

    #include 
    int main() 
    {    
        int i=2;    
        int j = i + (1, 2, 3, 4, 5);   
        printf("%d\n", j);     
        return 0;
     }
    

  10. A.

    4

    B.

    7

    C.

    6

    D.

    5

    View Answer

    Workspace

    Discuss Discuss in Forum