Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int first_num, second_num, first_max, second_max;
- System.out.print("Enter First Volume ");
- first_num = input.nextInt();
- System.out.print("Enter Second Volume ");
- second_num = input.nextInt();
- first_max = first_num;
- second_max = second_num;
- while(first_num > 0 && second_num > 0)
- {
- if(first_num > first_max)
- first_max = first_num;
- if(second_num > second_max)
- second_max = second_num;
- System.out.print("Enter First Volume ");
- first_num = input.nextInt();
- System.out.print("Enter Second Volume ");
- second_num = input.nextInt();
- }
- System.out.println("Highest Volumes are : " + first_max + " " + second_max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement