Write a java program to arrange 3 numbers (input by user)in descending order.
plzzzz its urgent!!!!!!!!!!
Answers
Answered by
1
Answer:
class spdf
{
public void app(int a, int b, int c)
{
if(a<b & & a<c)
System.out.println (
Answered by
2
Explanation:
import java.util.Scanner;
public class Desc
{
public static void main(String[] args)
{
int a,b,c;
Scanner sc=new Scanner(System.in);
System.out.print("Enter the 3 numbers");
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
int max=(a>b && a>c)?a:(b>c?b:c);
int min=(a<b && a<c)?a:(b<c?b:c);
System.out.println("descending order is "+max+","+(a+b+c-max-min)+","+min);
}
}
Attachments:
Similar questions
Biology,
5 months ago
Physics,
5 months ago
Social Sciences,
5 months ago
History,
10 months ago
English,
10 months ago
Computer Science,
1 year ago
Science,
1 year ago
Physics,
1 year ago