Java program to find biggest number between N number

Java program to find largest number between N number

Java program to find greatest number between N number

Java program to find maximum number between N number

Java program to find biggest number between 10 number

Java program to find biggest number between 21 number

Java program to find largest number between N number without using array

Program:-

import java.util.Scanner;

class group{
public static void main(String argn[]){
Scanner data = new Scanner(System.in);
int num, i, temp, max;
// Reading numbers want to be read
System.out.print("Enter number you want to enter:");
num = data.nextInt();
System.out.println("Enter " +num+ " number");
// Reading 1st number
max = data.nextInt();
// Reading other number
for (i=1; i < num; i++) { temp = data.nextInt();
 if(temp < max)
continue;
else
// largest number
max = temp;
}
System.out.println("Largest Number is "+max);
}
}

Output:-

Enter number you want to enter:
10
Enter 10 number
248
445852
248
215
25854
2145
11458
21145
115
115585
Largest Number is 445852



Learn Java:-
Java codes

Java Programs:-
List of Java Programs

Leave reply

Add your comments here

Back to Top