Results 1 to 4 of 4
Like Tree2Likes
  • 2 Post By PhHein

Thread: Printing the largest integer out from 3 numbers?

  1. #1
    csanch11 is offline Member
    Join Date
    Oct 2013
    Posts
    46
    Rep Power
    0

    Default Printing the largest integer out from 3 numbers?

    What is a Java code that can print the largest integer out from 3 numbers?

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Printing the largest integer out from 3 numbers?

    Java Code:
    int a = 12;
    int b = 2;
    int c = -8;
    System. out.println(a);
    jim829 and JosAH like this.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    csanch11 is offline Member
    Join Date
    Oct 2013
    Posts
    46
    Rep Power
    0

    Default Re: Printing the largest integer out from 3 numbers?

    But what if I wanted to use 3 random numbers that is not stored in a, b, and c? For example I'll use "Scanner keyboard = new Scanner(System.in);" to input the 3 numbers after I run it and I want the program to decide which one is the largest number and print that number.

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Printing the largest integer out from 3 numbers?

    How would you do it with pen and paper?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. Largest and smallest numbers program
    By gquach in forum New To Java
    Replies: 1
    Last Post: 08-17-2013, 02:43 PM
  2. finding largest and smallest integer in array
    By csrLewis93 in forum New To Java
    Replies: 9
    Last Post: 02-18-2013, 04:37 AM
  3. Integer Comparison, Outputting Largest Integer Not Working
    By killingthemonkey in forum New To Java
    Replies: 4
    Last Post: 10-16-2011, 08:59 PM
  4. Replies: 12
    Last Post: 10-31-2010, 06:14 PM
  5. Finding largest and smallest integer
    By mlhazan in forum New To Java
    Replies: 2
    Last Post: 01-12-2008, 10:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •