Sunday, August 9, 2009

To find the largest number - java code

import java.io.*;
class largernumber
{
public static void main(String[] args) {
int x=800, y=7000, z=80000;
if (x>y){
if (x>z){
System.out.println("x is greater");
}
else{
if(z>y){
System.out.println("z is greater");
}
else{
System.out.println("y is greater");
}
}
}
else{
if (y>z){
System.out.println("y is greater");
}
}
}
}

No comments:

Post a Comment