Home / C Programming / Control Instructions :: Discussion

Discussion :: Control Instructions

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

     #include
     int main() 
     {   
        int i = 10, j = 15;  
        if(i % 2 = j % 3)           
           printf("Freshergate\n");     
        return 0;
    } 

     

  2. A.

    Error: Expression syntax

    B.

    Error: Lvalue required

    C.

    Error: Rvalue required

    D.

    The Code runs successfully

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    if(i % 2 = j % 3) This statement generates "LValue required error". There is no variable on the left side of the expression to assign (j % 3).


Be The First To Comment