Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner user_input = new Scanner(System.in);
- System.out.print("Enter your first number: ");
- int first_num = user_input.nextInt();
- System.out.print("Enter your second name: ");
- int second_num = user_input.nextInt();
- System.out.print("Enter your third name: ");
- int third_num = user_input.nextInt();
- int sum = 0;
- if( (first_num == -1) || (second_num == -1) || (third_num == -1) ){
- System.out.println(" ");
- System.out.println("You cannot enter -1 !! ");
- }
- else if( (first_num % 2 == 0) || (second_num % 2 == 0) || (third_num % 2 == 0) ){
- sum = first_num + second_num + third_num;
- System.out.println(" ");
- System.out.println("The total is " + sum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement