Computer Science, asked by DanteZBuB3472, 11 months ago

give three numbers A,B and C, write a program to write their values in an ascending order.

Answers

Answered by anu32901
1

Answer:

import java.util.*;

import java.io.*;

public class Ascending{

       public static void main(String[] args){

            Scanner sc=new Scanner(System.in);

           int a=sc.nextInt();

            int b=sc.nextInt();

            int c=sc.nextInt();

            int x[] = {a,b,c};  

             Arrays.sort(x);  

           for (int i = 0; i < 3; i++)  

           System.out.print( x[i] + " ");

     }

}

Explanation:

Similar questions