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

The government has decided that the free market price of cheese is too low. Farmers complain that the price floor has reduced their total revenue.Is this possib
Genetic engineering is used in the biotechnology industry to? (1) eliminate all infections in livestock (2) synthesize hormones such as insulin and human growt
1) what is the meaning of commutative property?2)what is the meaning of distributive property?3)what is the meaning of associative property?
explain how to do the factor tree for 75
what is the KE of a 1 kg ball traveling at 20 meters per second?
Compare Ponyboy and Cherry Valance
Compare Ponyboy and Cherry Valance
A 700-watt gasoline engine and a 300-watt electric motor both do 3 J of work. Which machine can do the work faster? Explain your answer.
What is the vertical asymptote for the function f(x) = ln(x + 4) - 2? Be sure to write your answer as an equation for a line.
The government has decided that the free market price of cheese is too low. Farmers complain that the price floor has reduced their total revenue.Is this possib