Sunday, September 4, 2016

JAVA PROGRAM TO FIND BIGGEST NUMBER BETWEEN N NUMBER



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


Bhanu Namikaze

Author & Editor

Bhanu Namikaze is an Ethical Hacker, Passionate Blogger, Web Developer, Student and Mechanical Engineer. He Enjoys writing articles, Blogging, Solving Errors, Surfing and Social Networking. Feel Free To Contact Me @ Bhanu.

0 comments:

Post a Comment

Popular Posts

Copyrights @ Interview Questions.Me - Blogger Templates Designed by Templateism - Distributed By Protemplateslab

  • (91) 5544 654942
  • Bhanu@HackingDream.net
  • Interview Questions

Copyrights @ Interview Questions.Me -A Site By Bhanu In Association With Hacking Dream