Evaluate the following if the value of x=7, y=5
x += x++ + x + ++y
114 Likes
x += x++ + x + ++y⇒ x = x + (x++ + x + ++y)⇒ x = 7 + (7 + 8 + 6)⇒ x = 7 + 21⇒ x = 28
Answered By
69 Likes
Evaluate the expression when x is 4:
x += x++ * ++x % 2;
A store has purchased some cola cans of various brands. It purchased 50 cans @ ₹15 per can, 30 cans @ ₹20 per can and 40 cans @ ₹21 per can. Write a Java program to compute how much amount did the store pay.