Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: I Need help!!!

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy I Need help!!!

    Implement a java method with three local int variables A,b,c
    Sort three of the values in ascending order by comparing and exchanging their values.
    end of program a<=b<=c must hold.


    its a util.scanner programme
    how do i create. I have tried but to no avail.




    package assignment;
    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 ");
    }




    }
    }


    * I only know up to here
    Last edited by lizartt; July 29th, 2012 at 03:06 AM.

  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: I Need help!!!

    what have you tried?
    You must have forgotten to paste your code before submitting your post

  3. #3
    Member
    Join Date
    Jul 2012
    Posts
    69
    My Mood
    Relaxed
    Thanks
    1
    Thanked 6 Times in 6 Posts

    Default Re: I Need help!!!

    try to use the code=java tags, like this:
    public static void main(String[] args){
          int a, b, c;
    }
    Qoute my post and see what i mean . Makes everything so much easier for everybody.

    Also regarding your problem, what is not working? Try to print out everything and give us the output.