0 0 votes why did the statement c++=b%(b-a) will gives error Programming in C programming-in-c programming output + – kd..... 953 views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply Shubhgupta commented Apr 20, 2018 reply Follow flag It will give you the lvalue required error because When you have an assignment operator in a statement, the LHS of the operator must be something the language calls an lvalue. For more info-https://stackoverflow.com/questions/33375136/lvalue-required-as-left-operand-of-assignment-error-when-using-c 0 0 replyShare srestha commented Apr 20, 2018 reply Follow flag will it not give undefined behaviour? 0 0 replyShare Shubhgupta commented Apr 21, 2018 reply Follow flag I think it will not give undefined behaviour because after changing the statement with c+=b%(b-a), it will run perfectly. 0 0 replyShare Please log in or register to add a comment.
0 0 votes It will give an lvalue required error because assignment operator requires its LHS should be in memory operand. Means LHS should be an assignable variable to which you can assign value. Here you are assigning the value to an expression that's why it is giving error. Soumya29 answered Apr 24, 2018 Soumya29 comment Share Follow 0 reply Please log in or register to add a comment.