Heading

Thursday, July 4, 2013

Finding biggest element in the Array


public class ArraySort {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
int i[]={60,70,100,20,5,1,88};
int j=i[0],k;
for(k=0;k<i.length;k++)
{
if(j<i[k])
{
j=i[k];   
}
 }
System.out.println(j);
    }

}
Output:-
100

No comments:

Post a Comment