y) "/>
Home / C Programming / Control Instructions :: Discussion

Discussion :: Control Instructions

  1. Which of the following statements are correct about the program?

    #include 
     int main()
     {    
         int x = 30, y = 40;   
         if(x == y)     
            printf("x is equal to y\n");     
         else if(x > y)      
            printf("x is greater than y\n");  
         else if(x "x is less than y\n")    
         return 0;
     } 
    
    

  2. A.

    Error: Statement missing

    B.

    Error: Expression syntax

    C.

    Error: Lvalue required

    D.

    Error: Rvalue required

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    This program will result in error "Statement missing ;"

    printf("x is less than y\n") here ; should be added to the end of this statement.

     

     

     


Be The First To Comment