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

If you have 25 questions on a test and if you answer 5 on correctly what percent did you answer correctly
3.7 + (0.4) - 0.26 simplifed
Where did the Battle of Megiddo take place for WW1
Matter has no heat energy when it is cold. True False
A sequence of nucleotides found in the DNA of this chromosome codes for a specific protein or trait. This segment of DNA is known as a(n)
In a normal cellular protein, where would you expect to find a hydrophobic amino acid like valine?
How to calculate force without acceleration?
If a number decreases from 1000 to 835 what is the rate of decrease?
When a president is impeached who takes over?
how do killer whales defending territory
ACCESS MORE