C Programming - Control Instructions - Discussion

Discussion Forum : Control Instructions - Point Out Correct Statements (Q.No. 2)
2.
Which of the following statements are correct about the below program?
#include<stdio.h>
int main()
{
    int i = 10, j = 15;
    if(i % 2 = j % 3)
        printf("IndiaBIX\n");
    return 0;
}
Error: Expression syntax
Error: Lvalue required
Error: Rvalue required
The Code runs successfully
Answer: Option
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).

Discussion:
20 comments Page 2 of 2.

Priyanka.s said:   1 decade ago
Can any one explain what is meant by Rvalue?

Ravi mishra said:   8 years ago
Please tell me the meaning of Lvalue.

Priyanka.s said:   1 decade ago
@sundar good explanation thank you.

Anjali said:   9 years ago
Nice explanation, thanks @Sundar.

Praveen said:   1 decade ago
@Sundar.. Good explanation :)

Keerthi kumar said:   1 decade ago
@sundar ...thanks..

Prashant3393 said:   8 years ago
Thanks @Sundar.

Nikhil said:   8 years ago
Thanks @Sundar.
(1)

Natasha said:   7 years ago
Thanks @Sundar.

Dhinesh said:   7 years ago
Thanks @Sundar.


Post your comments here:

Your comments will be displayed after verification.