Friday, October 7, 2011
Find the smallest number among three numbers
class Smallest {
public static void main( String[] args ) {
int a=7;
int b=14;
int c=34;
if (a<b){if (a<c){System.out.println("A is the smallest");}
else{ System.out.println("C");}
}else{ if (b<c){System.out.println("B is the smallest");}
else{System.out.println("C is the smallest");}}
}
}
Subscribe to:
Post Comments (Atom)
Powered by Blogger.
7 comments:
thanks a lot....u r genius
thanks.
thq :-)
super
Any other way using if else
Not too good
Bro akhari Mai sirf 3 bracket lagte hai
Post a Comment