Comments

User Comments for the tutorial:

Determining the largest number

Total comments: 23      View Tutorial    Discuss: Determining the largest number

Advertisement

Comments

please give more explanation for the above example
please give more explanation for the above example

Thank you very much for setting up the example and
Thank you very much for setting up the example and sharing the code. I feel there may be some redundancy after the first else statement. Best Regards, Kim

ya this example is too good , but if it is some wh
ya this example is too good , but if it is some what diffecult that will be better ok eny way thanks for this examples

please explain me about (string[] args) in the mai
please explain me about (string[] args) in the main method

BEING FRIENDLY AM HAPPY THAT NOW I CAN DO JUST A
BEING FRIENDLY AM HAPPY THAT NOW I CAN DO JUST A THING WITH JAVA.IT TAKES ME MORE THAN 3 WEEKS NOW TRYING TO UNDERSTAND WHAT WAS BEING TOUGHT BUT TODAY &I MEAN THIS DAY AM CAPABLE....KEEP ON HELPING US..THANX A LOT

If the task is display the largest number among 10
If the task is display the largest number among 100 integers, then what would be the solution, should we folow IF condition or Loop or something else please send the coding or the logic if anyone could solve this?

can we write a program in this way
class greaternumber { public static void main(String[] args) { int x=100,y=200,z=12; if (x>y && y>z) { System.out.println("x is the Greater number"); } else if(z>x && z>y) { System.out.println ("Z is the larget numb

The code is good
thanks a lot

any programmmers
in above this program we are initiating no to variables other than this declare only variables and compare and they should read the values at compilation time ao simply what is the syntax for input of charater or nos.

This progrom does not work for all the values
For example, If x = 2, y = 200 and z = 400 this program does not produce the output as it never compares y and z separately. I think another line of code should be added as in: class LargerNumber{ public static void main(String[] args) {

another example
This is another type of example for finding the largest number. class velu1 { public static void main(String args[]) { int a=3,b=1,c=4; if (a>b && a>c) { System.out.println("a is greatest"); } else if (b>c && b>a) { System.out.println("b

Yeah
How about between 6 or more numbers?

Compares the three numbers.
class Largernumber { public static void main(String[] args) { int x=600, y=700, z=6100; if (x>y) { if (x>z) { System.out.println("x is greater"); } else { System.out.println("z is

Good
This Program is Good but Add some Program of Thread also.

comment
This is a wrong example! if Z>Y>X,can't get the result!

This may be excessive but it's certainly accurate!
public class Comp3 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int x=1, y=2, z=3; if (x>y && x>z) { System.out.println("x is biggest"); } else if (y

if x is the smallest then it doesnt work
there should be an else statment in the main else.. public static void main(String[] args) { int x=5,y=0,z=3; if(x>y) { if(x>z) System.out.println(x); else { if(z>y) System.out.println(z); else Sy

thx
thank u 4 d code.. i really used it.. mor power.. God Bless..

last if-else seems not required
Hi there in this program listed above i am sure the last if condition is not requiredwhen already checked greatness of "a" and "b" if they are not greatest the remaining intity "c" will automatically be the greatest. in place of this form of this lo

hi
public static void main(String[] args) { int x=5,y=0,z=3; if(x>y) { if(x>z) System.out.println(x); else { if(z>y) System.out.println(z); } } else { if(y>z) System.out.println(y); else System.out.println(z); } }

Hello
This is just for three integers, how about if we have ten or more integers?

largest No
public class B{ public static void main (String args[]){ int a=50,b=40,c=30; if (a>b&&a>c){ System.out.println("a");} else if (b>a&&b>c) {System.out.println("b");} else{ System.out.println("c");} }}

c++ programming
can you answer my question the using a while loop 10 numbers and display the largest among 10 numbers enter a number:10 enter a number:15 to the largest is 15

Related Tutorial and Articles
Java Beginners

example explanation - Java Beginners
example explanation  can i have some explanation regarding...(); } } } --------------------------------------------- Read for more information. http://www.roseindia.net/java

Java Beginners

explanation - Java Beginners
java application.   Hi Friend, Please visit the following links to know about the Garbage collection. http://www.roseindia.net/java/beginners/GarbageCollection.shtml http://www.roseindia.net/java/example/java/io/code

Java Beginners

please help me to give code - Java Beginners
(); } } } ------------------------------- read for more information, http://www.roseindia.net/java/beginners/read...please help me to give code  Write a program that reads a file named... of a tie, you may print out only one of them. For example in the file: Alan Turing

Java Beginners

please help me to give code - Java Beginners
please help me to give code  Write a program that prints an n-level...(); } } } ---------------------------------- read for more information, http://www.roseindia.net/java

Java Beginners

please help me to give code - Java Beginners
please help me to give code  Write a function with a signature cheerlead(word) that prints a typical cheer as follows. The word robot: Gimme an R Gimme an O Gimme a B Gimme an O Gimme a T What did you give me? ROBOT

Java Beginners

please help me to give code - Java Beginners
please help me to give code  Write a function, sliding(word, num)that behaves as follows. It should print out each slice of the original word having length num, aligned vertically as shown below. A call to sliding(examples, 4

Java Beginners

explanation
; Hi,can I know what is the meaning for the above coding?I have find the explanation in internet,but not very clear about it. Thank you

Java Beginners

please help me to give code - Java Beginners
please help me to give code  Write a program that uses loops to generate an n x n times table. The program should get n from the user. As a model here is a 4 x4 version: | 1 2 3 4

Swing AWT

please give me a java program for the following question
please give me a java program for the following question  Write a java program that displays multiple frames : Step 1: Design a frame with three... is an example that displays three buttons and display another frame when

Java Beginners

give idea
give idea  how to plot graph in java   Please visit the following link: http://www.roseindia.net/java/example/java/swing/draw-simple-bar-chart.shtml