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
Elodia [21]
3 years ago
8

What is x after evaluating?

Computers and Technology
1 answer:
denis23 [38]3 years ago
4 0

Answer:

3

Explanation:

In programming, there is a lot of conditional operators.

like NOT (&&) operator, OR (||) operator.

similarly, there is an operator called the ternary operator. It takes three operands and it behaves like the if-else statement.

syntax:

(condition) ? expression 1 : expression 2;

Working:

If the condition is true, then it executes the expression 1 and if the condition is false, then it executes the expression 2.

let see the Question,

x=(2>3) ? 2 : 3;

the condition (2 > 3) is false, 2 always less than 3 not greater than 3.

Therefore, it executes the value 3 and assigns to x.

You might be interested in
A hot spot is the __________. A. Point that collides with other objects B. Point an object spins around when it rotates C. First
Ber [7]
I would think it's A
5 0
4 years ago
What are the computer/electronic needs<br> that drive our economy today?
Nesterboy [21]

Power plants, water, dams, and electricity.

8 0
3 years ago
Windows OS and Mac OS are examples of which type of operating system?
german
Windows OS and Mac OS are examples of single user, multi tasking Operating Systems.
5 0
4 years ago
Read 2 more answers
What is displayed on the console when running the following program?
uranmaximum [27]

I guess there should be the program code in your question. I presume that the complete version of your question is the following:

What is displayed on the console when running the following program?

public class Test {

 public static void main(String[] args) {

   try {

     System.out.println("Welcome to Java");

     int i = 0;

     int y = 2 / i;

     System.out.println("Welcome to HTML");

   }

   finally {

     System.out.println("The finally clause is executed");

   }

 }

}

A.  Welcome to Java, then an error message.

B.  Welcome to Java followed by The finally clause is executed in the next line, then an error message.

C.  The program displays three lines: Welcome to Java, Welcome to HTML, The finally clause is executed, then an error message.

D.  None of the above.

Answer to the complete question with explanation:

B.     Welcome to Java followed by The finally clause is executed in the next line, then an error message

After entering <em>try/catch</em> block program will output <em>"Welcome to Java"</em>.

Then <em>ArithmeticException</em> will be raised at line:

<em>int y = 2 / i;</em>

The reason is division by <em>0</em> because <em>i = 0</em>.

After that <em>finally</em> clause will be executed despite exception thrown which will output <em>"The finally clause is executed"</em>.

There could be a chance that you have modified answers to your question. In that case:

Answer to the original question:

a. Welcome to Java,

c. The finally clause is executed, then an error message.

7 0
4 years ago
Q Basic program write a program in Q Basic to find the cost of 10 pens when the cost of 15 pens is 75 use unitary method to find
Ne4ueva [31]

give the function of cpu

5 0
3 years ago
Other questions:
  • HELP ASAP!!!! PLEASE !!! What information does the Media Access Control (MAC) on a network card provide?
    9·2 answers
  • 9. A change in the appearance of a value or label in a cell
    5·1 answer
  • I want to discard my old computer and want to securely erase the data from my hard drive what is the process called.
    14·2 answers
  • LAB: Even/odd values in an array
    9·2 answers
  • PLEASE HELP FAST
    5·1 answer
  • Difference between private and confidential data?​
    5·1 answer
  • In excel online what is it called when you join connecting cells together to span across more than one column and/or row?
    7·2 answers
  • It means fruit- trees garden.
    8·1 answer
  • Which phrases in the passage provide clues that trifling means "silliness” or "insignificance”? Check all that apply.
    12·1 answer
  • Given a string on one line and an integer index on a second line, output the character of the string at that index.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!