Computer Science, asked by surpawar24, 4 months ago

21. y = (x > 6 ? 4:6); What will be the
value of y if x = 8?

Answers

Answered by anmolg618ag
12

Answer:

the answer will be 4. it's a if else statement

Answered by sarahssynergy
4

if the given condition is statisfied the 1st answer will get assigned to y else if the second answer is assigned to y.

Explanation:

  • the expression x>6 ? 4:6 mean
  • if the given value x is greater than 6, then the y get assigned to 4.
  • if the x value is not greater than 6 then y get assigned to 6.
  • given x=8 and the statement 8>6 is true, therefore y get assigned to 4.
  • y=4.
Similar questions