Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LargestNumber {
- public static void main(String args[]) {
- int[] a = new int[] { 20, 30, 50, 4, 71, 100};
- int max = a[0];
- for(int i = 1; i < a.length;i++) {
- if(a[i] > max) {
- max = a[i];
- }
- }
- System.out.println("From The Array Element Largest Number is:" + max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement