Post a New Question

Java

posted by on .

Can someone please help me out!!!I included what I have so far.

*Purpose
Implement a Java-method with three local int variables a, b, c, d and e that sorts these three values in ascending order by comparing and exchanging their values. At the end of the program a <= b <= c <= d <= e must hold.

  • Java - ,

    I think you need to suggest some code first for us to comment on.

  • Java - ,

    import java.util.Scanner;

    public class Q3 {

    public static void main(String[] args) throws Exception

    {

    int A,B,C,D;
    String result;
    Scanner reader= new Scanner(System.in);
    System.out.print("Enter value A : ");
    A=reader.nextInt();
    System.out.print("Enter value B :");
    B=reader.nextInt();
    System.out.print("Enter value C :");
    C=reader.nextInt();




    if (A>B)
    D=A;
    A=B;
    B=D;

    {
    System.out.println("Results is ");
    }




    }
    }

Answer This Question

First Name:
School Subject:
Answer:

Related Questions

More Related Questions

Post a New Question