Write a java program to enter 3 numbers and print then in descending order
Answers
Answered by
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