So, I have homework until tomorrow, I've been sitting trying to find my problem for an hour and I couldn't find. No, it doesn't give me an error, but the compilator doesn't progress after a user enters a number.
The assignment is to write a program which detects if a number is a positive one, a negative one or a zero. (We must use nested if statement)
I feel so stupid lol, I need a more difficult program in class, yet cannot do this simple one.package gg; import java.util.*; public class AAA { public static void main(String[] args) { int a; Scanner kb = new Scanner (System.in); System.out.print("Please enter any number: "); a=kb.nextInt(); if (a==0){ System.out.print("The number is a zero"); if(a>0) { System.out.print("The number is positive."); } else { System.out.print("The number is negative."); } } kb.close(); } }