subject

Consider the following code segment:

if (value > 0)

System. out. println("positive");

if (value < 0)

System. out. println("negative");

if (value == 0)

System. out. println("neither");

Rewrite the code in the space below so that it uses an if-else structure instead of 3 if statements.

IM struggling does anyone know how to do this

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, mariahrpoulin9630
Which part of the cpu accepts data?
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, smariedegray
All of the following are characteristics that must be contained in any knowledge representation scheme except
Answers: 3
image
Computers and Technology, 22.06.2019 21:30, mima851
Elements such as fonts colors visual structure graphics and the interface of a web page should complement each other to ensure blank
Answers: 3
image
Computers and Technology, 23.06.2019 21:30, mariah10455
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
You know the right answer?
Consider the following code segment:

if (value > 0)

System. out. println(...

Questions in other subjects:

Konu
English, 14.02.2021 03:10