give output of the program snippet
int a=10,b=12;
if(a>=10)
a++;
else
++b;
S. o. pln("a ="+ a +"and b =" + b);
Answers
Answered by
7
a = 10
and b= 13
since the value of a is increasing after printing and the value of b is increasing before printing means a has the condition of post-fix increment and b has the condition of prefix increment.
Answered by
1
Answer:
a=10
b=12
Explanation:
As the condition is true, a++ will execute and as it is postfix, there will be change in value after printing.
Similar questions