(1). what will be the output when: (a) val 500 (b) val = 1500 int val,sum,n=550; sum=n+val>1750? 400:200; system.out.print(sum);
Answers
Answered by
103
Hi,
a)val=500
Execution:
sum=(500+550)>1750?400:200
sum=1050>1750?400:200;
Output:
200
b)val=1500
Execution:
sum=(1500+550)>1750?400:200
sum=2050>1750?400:200;
Output:
400
#hope it helps.
a)val=500
Execution:
sum=(500+550)>1750?400:200
sum=1050>1750?400:200;
Output:
200
b)val=1500
Execution:
sum=(1500+550)>1750?400:200
sum=2050>1750?400:200;
Output:
400
#hope it helps.
ananya071:
welo
Similar questions