Please help me how to get the value of y and what will be the correct answer.
8/5/2019 4:29:06 PM
So it means the correct answer is 0 Please correct me if I am wrong
But the data type of y is int so please tell why the answer will be 0.0 ?? Thanks for replying
I think the answer should be 0. Please tell me the reason for 0.0 as the correct answer
Because %, * and / have the same operator precedence, the operations will be performed from left to right.
int x=5 ;
int y= x++ + x++ - ++x;
help me for this operation?
thankx Khushi for helping , I had done operator concept but sometime it make lots of confusion ...
but again I will definatly work on this
y = 1 % 1 * 1 / 1
The remainder of 1/1 multiplied by 1/1
the division gives you a float. if it were floor division meaning // it wouldn't be.
Shubham the answer of your question is y=5+6-7=4.
Learn about pre and post increment operators.I hope you understand
Learn Playing. Play Learning
Send us a message