package com.tutorial4u;
public class LargestAmongThreeNumbers {
public static void main(String[] args) {
int a = 10;
int b = 50;
int c = 30;
if(a>b && a>c){
System.out.println("a is largest number.");
}else if(a<b && b>c){
System.out.println("b is largest number");
}else if(a < c && b <c){
System.out.println("c is largest number");
}else{
System.out.println(" a , b , c are same");
}
}
}
Output :
b is largest number
No comments:
Post a Comment