What is the result stored in x, after evaluating the following expression?
int x = 5; x = x++ * 2 + 3 * --x;
42 Likes
x = x++ * 2 + 3 * --x⇒ x = 5 * 2 + 3 * 5⇒ x = 10 + 15⇒ x = 25
Answered By
23 Likes
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.