Question

Three numbers are given. Arrange them in non-decreasing order. Input format Three numbers are given. Output...

Three numbers are given. Arrange them in non-decreasing order.
Input format
Three numbers are given.
Output format
Get the answer to the task.

Homework Answers

Answer #1
import java.util.*;

public class Main
{
        public static void main(String[] args) {
            
            Scanner sc= new Scanner(System.in);
            System.out.println("Enter the three numbers");
            
            int[] ar= new int[3];
            for(int i=0;i<3;i++)
                ar[i]=sc.nextInt();
            
            Arrays.sort(ar);
            System.out.println("Non-decreasing order :");
            for(int i=0;i<3;i++)
                System.out.println(ar[i]);
        }
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Indentify the type of force in each and arrange them in order of decreasing boiling point....
Indentify the type of force in each and arrange them in order of decreasing boiling point. CH3NH2 CH3OCH3 NaCl
For same heat input and work done/required, arrange the above cycle in decreasing order of efficiency...
For same heat input and work done/required, arrange the above cycle in decreasing order of efficiency with your justification. Carnot cycle, Duel cycle, Carnot refrigeration cycle, Rankine cycle, Vapor compression cycle and Brayton cycle in your own words
Consider the following reductions and arrange them in order of decreasing tendency to occur from the...
Consider the following reductions and arrange them in order of decreasing tendency to occur from the given reactions (or lack of reaction) below: Reductions: IrCl63- -- Ir S -- H2S HClO2 -- Cl- F2 -- F- CeOH3+ -- Ce3+ Reactions 1.Ir +S -> No Reaction 2. F2 + Ce3+ -> CeOH3+ + F- 3. Ir + HClO2 -> Cl- IrCl63- 4. HClO2 + Ce3+ -> No Reactions Explain how you arrive at your arrangement. What substance is the strongest reducing...
Arrange the following in the decreasing order (most important first) of their importance, for the welfare...
Arrange the following in the decreasing order (most important first) of their importance, for the welfare of human society. Give reasons for your answer. Biogas, citric acid, penicillin and curd.
Arrange the following in the decreasing order (most important first) of their importance, for the welfare...
Arrange the following in the decreasing order (most important first) of their importance, for the welfare of human society. Give reasons for your answer. Biogas, citric acid, penicillin and curd.
Arrange the following in the decreasing order (most important first) of their importance, for the welfare...
Arrange the following in the decreasing order (most important first) of their importance, for the welfare of human society. Give reasons for your answer. Biogas, citric acid, penicillin and curd.
Arrange the following in the decreasing order (most important first) of their importance, for the welfare...
Arrange the following in the decreasing order (most important first) of their importance, for the welfare of human society. Give reasons for your answer. Biogas, citric acid, penicillin and curd.
Arrange the following in the decreasing order (most important first) of their importance, for the welfare...
Arrange the following in the decreasing order (most important first) of their importance, for the welfare of human society. Give reasons for your answer. Biogas, citric acid, penicillin and curd.
Part B Arrange the following ionic compounds in order of decreasing amount of energy released in...
Part B Arrange the following ionic compounds in order of decreasing amount of energy released in lattice formation: LiF, MgS, InN, and RbBr. Rank from greatest to least lattice energy. To rank items as equivalent, overlap them.
Arrange the complexes in order of decreasing stability. Rank from most stable to least stable. To...
Arrange the complexes in order of decreasing stability. Rank from most stable to least stable. To rank items as equivalent, overlap them. [CuF6]2+   [Ni(en)3]2+   [Ni(en)(H2O)4]2+   [Ni(NH3)6]2+
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT