Computer Science, asked by aditisingh12468, 10 months ago

Write a java program to enter 3 numbers and print then in descending order​

Answers

Answered by monasharma325
1

Answer:

Scanner reader = new Scanner(System.in); // Reading from System.in

System.out.println("Enter a number: ");

int n = reader.nextInt(); // Scans the next token of the input as an int.

Explanation:

if (a > b)

swap(a,b)

if (b > c)

swap(b,c)

if (a > b)

swap(a,b)

print a,b,c

Similar questions