Home / C Programming / C Preprocessor :: Point Out Errors

C Programming :: C Preprocessor

  1. Point out the error in the program

     #include
     #define SI(p, n, r) float si; si=p*n*r/100;
     int main()
     {    
        float p=2500, r=3.5;  
        int n=3;     
        SI(p, n, r);   
        SI(1500, 2, 2.5);     
        return 0;
     } 
    

     

  2. A.

    26250.00 7500.00

    B.

    Nothing will print

    C.

    Error: Multiple declaration of si

    D.

    Garbage values

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Point out the error in the program

      #include
      int main()
      {     
          int i;  
          #if A     
             printf("Enter any number:");          
             scanf("%d", &i); 
        #elif B   
          printf("The number is odd");       
       return 0;
     }
    

  4. A.

    Error: unexpected end of file because there is no matching #endif

    B.

    The number is odd

    C.

    Garbage values

    D.

    None of above

    View Answer

    Workspace

    Discuss Discuss in Forum