Saturday, 18 July 2015

SIMPLE PROGRAMME TO CHECK WHICH NUMBERS IS GREATEST OF ALL NUMBERS IN THE LIST USING ARRAY.

programme:- to check that which no. is greatest of all no. in the list.




public class array4
{
public static void main(String args[])
{
int a[]={8,10,56,65,3};
int x,i;
x=a[0];
for(i=0;i<5;i++)
{
if(x<a[i])
{
x=a[i];
}
}
System.out.println(x);
}
}

No comments:

Post a Comment