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);
Plz give correct Answer
Answers
Answered by
23
Answer:
58
Explanation:
--b being prefix decreases the value by 1 and then uses it
c++ being postfix uses the value in c and then increases by 1
anupama777vidya:
U..
Answered by
31
Answer:
9+40+9=58
since --b is prefix so it first reduces the value then uses it
while c++ first uses the value then increases it
Similar questions