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

C Programming :: C Preprocessor

  1. What will be the output of the program?

     #include
     #define MESS junk 
    
     int main() 
     {   
         printf("MESS\n");   
         return 0;
     } 
    

  2. A.

    junk

    B.

    MESS

    C.

    Error

    D.

    Nothing will print

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What will be the output of the program?

     #include 
     #define PRINT(i) printf("%d,",i) 
    
     int main()
     {   
        int x=2, y=3, z=4;  
        PRINT(x);     
        PRINT(y);   
        PRINT(z);    
        return 0;
     } 
    

  4. A.

    2, 3, 4,

    B.

    2, 2, 2,

    C.

    3, 3, 3,

    D.

    4, 4, 4,

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. What will be the output of the program?

     #include
     #define MAX(a, b, c) (a>b ? a>c ? a : c: b>c ? b : c) 
    
     int main() 
     {    
         int x;   
         x = MAX(3+2, 2+7, 3+7);      
         printf("%d\n", x); 
         return 0; 
    } 
    

  6. A.

    5

    B.

    9

    C.

    10

    D.

    3+7

    View Answer

    Workspace

    Discuss Discuss in Forum