Ask Question
11 October, 01:14

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

+3
Answers (1)
  1. 11 October, 01:41
    0
    if (value > 0)

    System. out. println ("positive");

    else

    if (value < 0)

    System. out. println ("negative");

    else

    System. out. println ("neither");
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Consider the following code segment: if (value > 0) System. out. println ("positive"); if (value < 0) System. out. println ("negative"); if ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers