Computer Applications
What will be the output for the following program segment?
int a=0,b=10,c=40;
a = --b + c++ +b;
System.out.println(" a = " + a);
Java
Java Operators
101 Likes
Answer
a = 58
Working
a = --b + c++ + b
⇒ a = 9 + 40 + 9
⇒ a = 58
Answered By
61 Likes
Related Questions
If m=5, n=2; what will be the output of m and n after execution?
i. m -= n ii. n = m + m/n
State the difference between = and ==.
What will be the output of the following if x=5?
i. 5 * ++x
ii. 5 * x++Evaluate the following expressions, if the values of the variables are a = 2, b = 3 and c = 3
i. a - (b++) * (--c)
ii. a * (++b) %c