Java input problem
Hi! Here's my code: public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a; int b; System.out.print("Give first number: "); a = sc.nextInt(); System.out.print("Give second number: "); b = sc.nextInt(); int sum = a + b; if (a <=0) { System.out.println("Must be positive and above zero"); } else if ( b <= 0) { System.out.println("Must be positive and above"); } else{ System.out.print("The sum of first and second number is: "+sum); System.out.println(); } } } How to correct to stop immediately after the first number is <= 0 without asking for the second number??