Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package JavaRabbil;
- import java.util.Scanner;
- public class LargestNum {
- public static void main(String args[]){
- int a,b,c;
- Scanner sc = new Scanner(System.in);
- System.out.println("Enter input A");
- a = sc.nextInt();
- System.out.println("Enter input B");
- b = sc.nextInt();
- System.out.println("Enter input C");
- c = sc.nextInt();
- if (a>b && a>c){
- System.out.println("A is largest : "+a);
- }
- else if (b>a && b>c){
- System.out.println("B is largest : "+b);
- }
- else if (c>a && c>b){
- System.out.println("C is largest : "+c);
- }
- else if (a==b && b==c && c==a){
- System.out.printf("a-%d , b-%d , c-%d = same input here ",a,b,c);
- }
- else{
- System.out.println("wrong Input");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement