import java.io.DataInputStream; class Largest { public static void main(String args[])throws Exception { int a[]=new int[5]; int la; DataInputStream ob=new DataInputStream(System.in); System.out.println("Enter 5 values:"); for(int j=0;j<5;j++) { a[j]=Integer.parseInt(ob.readLine()); } System.out.println("your values:"); for(int j=0;j<5;j++) { System.out.print(" "+a[j]); } la=a[0]; for(int j=0;j<5;j++) { if(la<a[j]) { la=a[j]; } } System.out.println(" "); System.out.println(" "); System.out.println("Largest value="+la); } }
Saturday, 1 June 2013
Largest Number Java
Published June 01, 2013
Artikel Terkait
- Infix Expression : Any expression in the standard form like "2*3-4/5" is an Infix(
- 1.What is Constructor? A constructor is a special method whose task is to initialize
- 7.How do I load a database driver with JDBC 4.0 / Java 6? Provided the JAR file co
- Deadlock Definition A set of processes is deadlocked if each process in the set is waiti
- The RSA algorithm is used for both public key encryption and digital signatures. It is t
- 1.What is the Comparable interface ? The Comparable interface is used to sort collec
Subscribe to:
Post Comments (Atom)
EmoticonEmoticon