Write a java program which takes two numbers as a input and perform following operation using switch: - Pratik Ghelani

Pratik Ghelani

Breaking

Friday, January 25, 2019

Write a java program which takes two numbers as a input and perform following operation using switch:

Program:-

import java.util.Scanner;
public class p4{
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int a,b;
System.out.print("Enter the First numbers: ");
a =sc.nextInt();
System.out.print("Enter the Second numbers: ");
b = sc.nextInt();
if(a>b)
{
System.out.println(a+"is big");
}
else
{
System.out.println(b+" is big");
}
}

}

Output:-





No comments:

Post a Comment