1.

Find the output of the following program segment, when val=500.Sum = val > 650? 400 : 200;System.out.println(Sum);​

Answer»

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.

by nivaskumar



Discussion

No Comment Found