Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

Write a Java program to check the smallest value between two numbers.(5&10)

OpenStudy (tacotime):

Try an if statement.

OpenStudy (anonymous):

Here comapring two value. The esaiest way I think is the following code : public class SmallDemo{ public static void main(String[] arg){ int value1 = 5; int value2 = 10; if(value1 < value2){ System.out.println(value1 + " smaller than " + value2); }else{ System.out.println(value2 + " smaller than " + value1); } } }

OpenStudy (woodrow73):

minor adjustment to above code in the else block: ``` System.out.println(value2 + " smaller than or equal to " + value1); ```

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
16 hours ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
19 hours ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Arizona: does anyone know the percentage rate of 30,000 and 40,000
1 week ago 0 Replies 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!