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...
Write a machine language program to input two one-digit numbers, add them, and output the one-digit...
Write a machine language program to input two one-digit numbers, add them, and output the one-digit sum. There can be no space between the two one-digit numbers on input. Write the program in a format suitable for the loader and execute it on the Pep/9 simulator. It needs to be in hexadecimal, I am just confused on how to input numbers on the PEP/9 machine.
For the following set of atoms and ions, arrange the members in order of decreasing size:...
For the following set of atoms and ions, arrange the members in order of decreasing size: Rank items from largest to smallest. To rank items as equivalent, overlap them. Co3+ , Fe3+, Fe2+
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.