1234afrozjahan1234 1234afrozjahan1234
  • 19-08-2020
  • Computers and Technology
contestada

ternary operators of computer

please explain. ​

Respuesta :

GrandNecro
GrandNecro GrandNecro
  • 19-08-2020

Answer:

It's a compact way of doing an if-else statement.

General Format is

<condition> ? <if condition is true> : <else>;

Example:

I could rewrite:

  if(a==1) temp = 1;

  else     temp = 999;

as

  temp = (a==1) ? 1 : 999;

Answer Link

Otras preguntas

can someone help me with this problem
How do you find 25 to the power of 1/2?
during a recent regular season, a taxas ranger baseball player had 126 hits and was a bat 399 times. write a fraction in simplest form to represent the ratio o
what are the starting ingredients of photosynthesis?
Rebecca scored 60 out of 75 in her end of year test. What percentage mark did her teacher give her?
How do you write 7.208 in expanded notation form
“A horse pulls on a cart. By Newton’s third law of motion, the cart pulls back on the horse with a force equal to that exerted by the horse on the cart. The su
during a recent regular season, a taxas ranger baseball player had 126 hits and was a bat 399 times. write a fraction in simplest form to represent the ratio o
why co does not obey lewis octet rule
Number 13 please show me in the least steps possible