P. 1
Java Final Submission (java programs)

Java Final Submission (java programs)

5.0

|Views: 4,652|Likes:
Published by TB

More info:

Published by: TB on May 22, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

02/18/2014

pdf

text

original

import javax.swing.*;
class Que_20
{

public static void main(String[] args)

{

String n1= JOptionPane.showInputDialog (null,"ENTER THE FIRST
NUMBER:");

String n2 =JOptionPane.showInputDialog (null,"ENTER THE SECOND
NUMBER:");

int num1=Integer.parseInt(n1);
int num2=Integer.parseInt(n2);
String msg;

if(num1>num2)
{

msg=String.format("THE FIRST NUMBER IS GREATER ie:
%d",num1);

}

else
{

msg=String.format("THE SECOND NUMBER IS GREATER ie:
%d",num2);
JOptionPane.showMessageDialog(null,msg);

}

}

}

Output

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->