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
5

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

Answered by jagruti6551
41

Answer:

hope it is helpful for you.

Attachments:
Similar questions