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

How to write nine and twenty six hundredths in number form
what is 109985 rounded to the nearest hundred thousand
a=v1-v0/t solve for v1
4 1/2 divided by 1 5/8
HELP ASAP Jorge is 1 year younger than his brother. The sum of their ages is no less than 25 years. Enter an inequality that can be used to represent this
round 16,500 to the nearest ten thousand
what is -1.65 as a fraction in simplest form
HELPPP 4 1/8÷1/8 simplified
If you didn't/don't eat breakfast, where are you getting this energy from?
what did the meiji reformers want to retain, despite their quest for modernization?