Sort_IntegersJava

Sort_IntegersJava - int k=Integer.parseInt(thirdInput)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 import javax.swing.JOptionPane class Sort3{ public static void main(String args[]){ String firstInput String secondInput String thirdInput firstInput=JOptionPane.showInputDialog("enter your first number") secondInput=JOptionPane.showInputDialog("enter your second number") thirdInput=JOptionPane.showInputDialog("enter your third number") int i=Integer.parseInt(firstInput) int j=Integer.parseInt(secondInput)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int k=Integer.parseInt(thirdInput) if(i>j) {if(i>k) {System.out.println(i) if(k>j) System.out.println(k+"\n"+j) else System.out.println(j+"\n"+k) } else System.out.println(k+"\n"+i+"\n"+j) } else {if(j>k) {System.out.println(j) if(k>i) System.out.println(k+"\n"+i) else System.out.println(i+"\n"+k) } else System.out.println(k+"\n"+j+"\n"+i) } } }...
View Full Document

This note was uploaded on 07/26/2011 for the course IT 218 taught by Professor Accampo,e during the Spring '11 term at ITT Tech Pittsburgh.

Ask a homework question - tutors are online