class pup
{
public static void main (String [] args)
{
int a,b,op; int c = 0;
Scanner fSC = new Scanner(System.in);
System.out.println("Welcome to CMD basic calculator!\n"+"Press ENTER key to continue . . .");
Scanner aKey = new Scanner(System.in);
String akeyp = aKey.nextLine();
System.out.println("Enter first number:"); a = fSC.nextInt();
System.out.println("Input operator to be used( Ex. 1):\n"+"1. Addition\n"+"2. Subtraction\n"+"3. Multiplication\n"+"4. Division"); op = fSC.nextInt();
System.out.println("Enter second number:"); b = fSC.nextInt();
if (op==1) { c = a+b; } else if (op==2) { c = a-b;} else if (op==3) { c = a*b;} else if (op==4) { c = a/b; } else {
System.out.println("You have entered a wrong operator value !");
System.exit(0);
}
System.out.println("The Answer is "+c);
}
}
import java.util.*;
class pup
{
public static void main (String [] args)
{
int a,b,op; int c = 0;
Scanner fSC = new Scanner(System.in);
System.out.println("Welcome to CMD basic calculator!\n"+"Press ENTER key to continue . . .");
Scanner aKey = new Scanner(System.in);
String akeyp = aKey.nextLine();
System.out.println("Enter first number:"); a = fSC.nextInt();
System.out.println("Input operator to be used( Ex. 1):\n"+"1. Addition\n"+"2. Subtraction\n"+"3. Multiplication\n"+"4. Division"); op = fSC.nextInt();
System.out.println("Enter second number:"); b = fSC.nextInt();
if (op==1) { c = a+b; } else if (op==2) { c = a-b;} else if (op==3) { c = a*b;} else if (op==4) { c = a/b; } else {
System.out.println("You have entered a wrong operator value !");
System.exit(0);
}
System.out.println("The Answer is "+c);
}
}
import java.util.*;
class pup
{
public static void main (String [] args)
{
int a,b,op; int c = 0;
Scanner fSC = new Scanner(System.in);
System.out.println("Welcome to CMD basic calculator!\n"+"Press ENTER key to continue . . .");
Scanner aKey =