Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class HigestNumber {
- public static void FindMax(double x,double y)
- {
- if(x > y)
- {
- System.out.println("Maximum value of two number : "+x);
- }
- else
- {
- System.out.println("Maximum value of two number: " + y);
- }
- }
- public static void FindMax(double x, double y,double z)
- {
- if(x>y && x>z)
- {
- System.out.println("Maximum value of three number : "+x);
- }
- else if(y > x && y > z)
- {
- System.out.println("Maximum value of three number : "+y);
- }
- else
- {
- System.out.println("Maximum value of three number : "+z);
- }
- }
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- double a,b,c;
- System.out.print("Enter Your First Number: ");
- a = input.nextDouble();
- System.out.print("Enter Your Second Number: ");
- b = input.nextDouble();
- System.out.print("Enter Your Third Number: ");
- c = input.nextDouble();
- FindMax(a,b);
- FindMax(a,b,c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement