import java.util.Scanner;
class calc
{
public static void main(String arg[])
{
Scanner sc=new Scanner(System.in);
int a,b,c;
String opp;
System.out.print("Enter First Value: ");
a=Integer.parseInt(sc.next());
System.out.print("Enter second value: ");
b=Integer.parseInt(sc.next());
System.out.print("Enter opperator : ");
opp=sc.next();
if (opp.equals("+"))
{
System.out.println(a+b);
}
else
if (opp.equals("-"))
{
System.out.println(a-b);
}
else
if (opp.equals("*"))
{
System.out.println(a*b);
}
else
if (opp.equals("/"))
{
System.out.println(a/b);
}
}
}
0 comments:
Post a Comment