write a program in bluej input three numbers print the highest and lowest assuming of them and assuming the three numbers as input in "bluej"
Answers
Answered by
0
Answer:
import java.util.*;
class high_low
{
int num1,num2,num3;
private void highest()
{
int highest =
th.max(num1,Math.max(num2,num3));
System.out.println("highest number="+highest);
}
private void lowest()
{
int lowest= Math.min(num1,math.min(num2,num3));
System.out.println("Lowest number="+lowest);
}
void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("enter 3 numbers");
num1=sc.nextInt();
num2=sc.nextInt();
num3=sc.nextInt();
highest();
lowest();
}
}
Similar questions