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

In a certain town, 80% of all married men are working, and 75% of all married men are over 35 years old. Among working married men, 70% are over 35 years old. W
What is the value of t in the equation 3(t − 4) = 2t + 1?
Hey yall. If someone writes me an essay about mentally strong people. They get something. I need 4 paragraphs rn.
factorize 4y^2 - 2^2?​
Which statement is false? a. The density of a gas is constant as long as its temperature remains constant. b. Gases can be expanded without limit. c. Gases diff
HelpActivity:2x²2+2x-312=0​
Temporary Aid to Needy Families (TANF) a. A welfare program that replaced AFDC in 1996. It introduced a new education requirement that was designed to push w
What value of P makes the equation true 12-p+5=9 P=4 P=6 P=8 P=16
help with Spanish plssss
Write an equation for the nth term of the arithmetic sequence. Then find 230 - -9, -6, -3,0, ... = a30 Helpquick