#include<iostream>
using namespace std;
int main()
{
int a, b;
cout << "Enter first number : " << endl; cin >> a;
cout << "Enter second number : " << endl; cin >> b;
cout << "Enter symbol of operation to perform : " << endl;
cin.ignore();
cout << flush;
char c;
cin >> c; // We take character input like +, -, / or *
switch(c) // switch statement take c as parameter.
{
case '+':
cout << "Sum of " << a << " + " << b << " = " << a+b << endl;
break;
case '-':
cout << "difference of " << a << " - " << b << " = " << a-b << endl;
break;
case '*':
cout << "Mulitplication of " << a << " * " << b << " = " << a*b << endl;
break;
case '/':
cout << "division of " << a << " / " << b << " = " << a/b << endl;
break;
}
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkKewogICAgaW50IGEsIGI7CiAgICBjb3V0IDw8ICJFbnRlciBmaXJzdCBudW1iZXIgOiAiIDw8IGVuZGw7IGNpbiA+PiBhOwogICAgY291dCA8PCAiRW50ZXIgc2Vjb25kIG51bWJlciA6ICIgPDwgZW5kbDsgY2luID4+IGI7CiAgICBjb3V0IDw8ICJFbnRlciBzeW1ib2wgb2Ygb3BlcmF0aW9uIHRvIHBlcmZvcm0gOiAiIDw8IGVuZGw7CiAgICBjaW4uaWdub3JlKCk7CiAgICBjb3V0IDw8IGZsdXNoOwogICAgY2hhciBjOwogICAgY2luID4+IGM7ICAgICAgICAgICAgICAgLy8gV2UgdGFrZSBjaGFyYWN0ZXIgaW5wdXQgbGlrZSArLCAtLCAvIG9yICoKCiAgICBzd2l0Y2goYykgICAgICAgICAgICAgICAvLyBzd2l0Y2ggc3RhdGVtZW50IHRha2UgYyBhcyBwYXJhbWV0ZXIuCiAgICB7ICAgCiAgICAgICAgY2FzZSAnKyc6CiAgICAgICAgICAgIGNvdXQgPDwgIlN1bSBvZiAiIDw8IGEgPDwgIiArICIgPDwgYiA8PCAiID0gIiA8PCBhK2IgPDwgZW5kbDsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAnLSc6CiAgICAgICAg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