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

Choose the prepositional phrase in the sentence.My brother hung his dirty, wet jacket in the hall closet.A. My brother hungB. his dirty, wet jacketC. in the hal
Which concept causes the downfall of humanity?
What is (+,+) reflected over the x axis?
write an equation for the function that includes the following points (2, 32) and (3, 64)
Fills the region around a magnet
2) A pharmacist has 60 ml of an 8% alcohol solution. How much water should be evaporated so that the solution that remains is 10% alcohol?
STATISTICS INTR Apr2020 2.1 Frequency Distributions and Their Graphs Objective 7011215 complete 2.1 24 Frog
Simplify: 3√2 x √ 3 .
A bag contains 5 red checkers and 9 black checkers. A checker is selected, kept out of the bag, and then another checker is selected. What is P(black, then red)
Answer the following questions about the paragraph on minute 3:13 of the lesson in full sentences. ¿Por qué están nerviosos los estudiantes? ¿Por qué está preoc