Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package activities;
- import java.util.Scanner;
- public class NestedStatmentsAct
- {
- public static void main(String[] args)
- { Scanner keyboard = new Scanner(System.in);
- double amt1, amt2;
- System.out.print("enter amt1: ");
- amt1 = keyboard.nextDouble();
- System.out.print("enter amt2: ");
- amt2 = keyboard.nextDouble();
- if (amt1>10)
- {
- if (amt2 < 100)
- {
- if (amt1 >amt2)
- {
- System.out.println(amt1);
- }
- else
- {
- System.out.println(amt2);
- }
- }
- else
- {
- System.out.println("amt2 is greater than 100");
- }
- }
- else
- {
- System.out.println("amt1 is not greater than 10");
- }
- keyboard.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement