Java program to find largest number in array

Previous
Next

In this tutorial, Java program to find the largest number in array.
Here is simple algorithm to find larget element in the array.

  • Initialize lrg with arr[0] i.e. first element in the array.
  • If current element is greater than lrg, then set lrg to current element.

Output:

Enter Array Size : 5
Enter Array Elements : 34 85 95 25 75
Searching for the largest Number….

Largest Number = 95

That’s all about Java program to find largest number in array.

Previous
Next

Join Our News Letter – Stay Updated

Subscribe to Awesome Java Content.




Add Comment

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog