Home / C Programming / C Preprocessor :: Yes / No Questions

C Programming :: C Preprocessor

  1. What will be the output of the program?

     #include'
     #define MAN(x, y) ((x)>(y)) ? (x):(y);
    
      int main() 
     {   
         int i=10, j=5, k=0;  
         k = MAN(++i, j++);     
         printf("%d, %d, %d\n", i, j, k);     
         return 0; 
    } 
    

  2. A.

    12, 6, 12

    B.

    11, 5, 11

    C.

    11, 5, Garbage

    D.

    12, 6, Garbage

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Will the program compile successfully?

     #include
     #define X (4+Y)
     #define Y (X+3) 
    
     int main() 
     {   
         printf("%d\n", 4*X+2);
         return 0;
     } 
    

     

  4. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Would the following typedef work?
    typedef #include l;

  6. A.
    Yes
    B.
    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Will the program compile successfully?

      #include
      int main()
      {   
          printf("Fresher" "Gate\n");     
          return 0;
      }
    

  8. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. It is necessary that a header files should have a .h extension?

  10. A.
    Yes
    B.
    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Will the program compile successfully?

    #include 
     int main() 
     {  
        #ifdef NOTE    
           int a;       
           a=10;    
      #else        
           int a;      
           a=20;  
        #endif 
        printf("%d\n", a);  
        return 0; 
    } 
    

  12. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Will the following program print the message infinite number of times?

     #include
     #define INFINITELOOP while(1) 
    
     int main() 
     { 
         INFINITELOOP         
         printf("Freshergate");     
         return 0; 
    } 
    

  14. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Will it result in to an error if a header file is included twice?

  16. A.
    Yes
    B.
    No
    C.
    It is compiler dependent.

    View Answer

    Workspace

    Discuss Discuss in Forum