write a program to accept 3 numbers with the help of scanner class and find largest one In java please urgent
Answers
Answered by
1
import java.util.*
class max
{
void main()
{
Scanner sc= new Scanner (System.in);
int n , m=0;
for (i=1;i<=3;i++)
{
System.out.println("Enter a number");
n=sc.nextInt;
if(n>max)
{
max=n;
}
}
System.out.println("The greatest number is" +max);
}
}
Similar questions