Wannabree
JCHJava Community | Help. Code. Learn.
•Created by Bolo on 4/14/2025 in #java-help
Java While Loop Question
Hey, Java noob here.
your
num1
will always be the first value you enter since it's outside of your while loop.
i don't know why it happens but when you enter a negative number, your first
is accessed and largest
is set to the initial num1
value.
i don't know what your homework/quiz is asking you to do but for this problem you pretty much only need onle else if()
18 replies