
WAP to calculate greatest of 3 numbers using classes and functions with parameters through input in main?

Java Find Largest Number
import java.util.*;
class FindLargest{
public static void main(String[] args){
int max = Integer.MIN_VALUE;
System.out.println("Enter 3 numbers:");
Scanner input=new Scanner(System.in);
for(int i=1;i<=3;i++){
int num=input.nextInt();
if (num > max) {
max = num;
}
}
System.out.println("Largest Number is: "+max);
}
}

Thanks for ur help ..
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.