Computer Science, asked by rishipranaav1, 2 months ago

Find the output of the following program segment,

when val=500.

Sum = val > 650? 400 : 200;

System.out.println(Sum);

Answers

Answered by nivasravirajkumar
2

val=500

Execution:

sum=(500+650)>1800?400:200

sum=1050>1800?400:200;

Output:

300

b)val=650

Execution:

sum=(1500+650)>1800?400:200

sum=2050>1800?400:200;

Output:

500

Answered by barani79530
0

Explanation:

--b = 10-1 = 9

c++ = 40

+b = 10

so

a = --b +c ++ + b;

or a= 9-40-10

Similar questions