Try this program may it help you out:
Code:
import java.io.*;
class Abc
{
public static void main(String str[])
{
int []a= new int[5];
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
try
{
System.out.pritnln(“Enter your 5 numbers”);
for(int i=0;i<=4;i++)
{
a[i]=Integer.parseInt(br.readLine());
}
}
catch(Exception e)
{
System.out.println(“Error found”);
}
int max=0;
max=a[0];
for(int j=1;j<=4;j++)
{
if(max<=a[j])
{
max=a[j];
}
}
System.out.println(“The biggest Number is” + max);
}
}
Bookmarks