+ 1
Pls what's wrong with this if else statement
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner num=new Scanner(System.in); int a =num.nextInt(); if (a > 0){ a*=2; }else if (a< 0){ a++; System.out.println(a); }else if (a == 0){ System.out.println(0); } } }
1 Odpowiedź
+ 2
Remove the last two parentheses("}") and you need to add Print statement in if it is greater than 0.