Skip to content

Instantly share code, notes, and snippets.

@imranhoshain
Created September 6, 2022 14:18
Show Gist options
  • Save imranhoshain/85464ab5d0d38b2528661e0c87c26052 to your computer and use it in GitHub Desktop.
Save imranhoshain/85464ab5d0d38b2528661e0c87c26052 to your computer and use it in GitHub Desktop.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package findmaxnumber;
import java.util.Scanner;
/**
*
* @author Spy Hacker
*/
public class FindMaxNumber {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner myObj = new Scanner(System.in);
int max, arry, i;
System.out.print("Enter how many input number: ");
arry = myObj.nextInt();
int num[];
num = new int[arry];
for (i=0; i<arry; i++){
System.out.print(i+" yout number: ");
num[i] = myObj.nextInt();
}
max = num[0];
for(i=0; i<arry; i++){
if(max < num[i]){
max = num[i];
}
}
System.out.println(max+" is large number");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment