Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class ex7e
- {
- public static void main(String[] args)
- {
- Scanner input = new Scanner(System.in);
- char option;
- do
- {
- System.out.print("Please enter a number : ");
- int num = input.nextInt();
- System.out.println();
- if(num <= 10)
- {
- for(int i = 0; i < 7; i++)
- {
- System.out.println("Less than 10");
- }
- }
- else if( num >= 10)
- {
- for(int i = 0; i < 4; i++)
- {
- System.out.println("Greater than 10");
- }
- }
- System.out.print("Would you like to enter another number : y/n? ");
- option = input.next().charAt(0);
- System.out.println();
- }
- while(option == 'y' || option == 'Y');
- System.out.print("Goodbye!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement