1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
m_a_m_a [10]
2 years ago
15

The ____ operator executes one of two expressions based on the results of a conditional expression. Group of answer choices

Computers and Technology
2 answers:
Mars2501 [29]2 years ago
8 0

Corrected or Complet Question

The ____ operator executes one of two expressions based on the results of a conditional expression.

a. .

b. ( )

c. ,

d. ?:

Answer:

(d) ? :

Explanation:

The ternary operator (? :) is an operator that executes one out of two expressions based on the results of a conditional expression. It is a faster or shorthand way of writing an if ... else statement. The operator checks the conditional expression and depending on whether it is true or false, one of its two statements will be executed. For example:

 String correct = (4 < 5) ? "yes" : "no" ;

In the code above,

i. the conditional statement is (4 < 5) and this will be tested for to return true or false.

ii. the first expression (the one after the ?) is "yes" which will be executed if the conditional statement returns true.

iii. and the second expression (the one after the : ) is "no" which will be executed if the conditional statement returns false.

Therefore, since the conditional expression returns true for 4 < 5, the first expression will be executed. i.e "yes". This means that the String variable <em>correct </em> will have a value of "yes".

tia_tia [17]2 years ago
7 0

Answer:

Conditional operator ?:                            

Explanation:

  • The conditional operator evaluates a condition and chooses one of the two expressions which depends on whether the condition evaluated to true or false.
  • The syntax of conditional statement is given below:

            conditional_expression ? expression1 : expression2;

  • Basically this operator takes three operands/expressions and if the first expression ( a conditional expression) evaluates to true then this means that the second expression is evaluated/executed and if the first expression evaluates to false then the third expression is evaluated.
  • Example:

                 int number = 16;

                 number%2 == 0 ? cout<<"even number" : cout<<"odd number";

  • This statement first checks the conditional expression number%2==0 is true or false.
  • Value of number variable is 16 and here % is the modulo operator which calculates the remainder after dividing one number by another.
  • So 16%2==0 because 16 is divisible by 2 and gives 8 as quotient and 0 as remainder.
  • So the conditional statement is true it means that the first expression will be executed.
  • Hence the output will be: even number
You might be interested in
Which option is the easiest way to configure macros in Access 2016?
zhuklara [117]
Number 2
Have a nice day
6 0
3 years ago
It converts Assembly Language into machine language?​
docker41 [41]

Answer:

An assembler.

Explanation:

Input is (as with any programming language) files with lists of instructions (typically assembler mnemonics), output is a binary format representing these instructions in machine language.

6 0
2 years ago
Express the following Boolean function using only the NOT and the AND operation
romanna [79]
Here, you go drawn , in paint. Please note that you can simplify further more the circuit by removing any two not following each other. 

3 0
3 years ago
Can someone help me with these questions?
REY [17]

website will be the first, hyperlink will be the second, A will be number three, and webpage will be number 4

8 0
3 years ago
How do programming languages work?
erastova [34]
A programming language acts as a translator between you and the computer. Rather than learning the computer's native language (known as machine language), you can use a programming language to instruct the computer in a way that is easier to learn and understand.
8 0
2 years ago
Other questions:
  • When you take a multiple-choice test, you are relying on ________, a means of retrieving information out of your long-term memor
    8·1 answer
  • Hello, can you help me answer these questions?
    9·2 answers
  • A file name extension provides what information about a file?
    10·2 answers
  • A(n) ____ path is a path used for external links that includes the complete address for the destination page, including the prot
    12·1 answer
  • Which of the following is true of the Internet as a medium for branding? a) The Internet is more effective as a media for brandi
    10·1 answer
  • Whatis NOT a key factor while designing a website?
    12·1 answer
  • What was the first 1.0.1 version of openssl that was not vulnerable to heartbleed?
    5·2 answers
  • I'm trying to export a video with HitFilm Express, I am either unable to click the export button or it gets to 43% and just stop
    5·1 answer
  • Draw a flowchart or write pseudocode to represent a program's logic that allows the user to enter a value. The program multiplie
    5·1 answer
  • Which marketing strategy is represented by advertisers paying for online display ads?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!