Learn Object Oriented Programming (OOP) in C++ / সি++ Here
# include using namespace std;FARJANA KAMAL KONOK20193070162 BATCHint main(){ char op; float num1, num2; cout << "Enter operator either + or - or * or /: "; cin >> op; cout << "Enter two operands: "; cin >> num1 >> num2; switch(op) { case '+': cout << num1+num2; break; case '-': cout << num1-num2; break; case '*': cout << num1*num2; break; case '/': cout << num1/num2; break; default: cout << "Error! operator is not correct"; break; } return 0;}
Comment Here
# include
ReplyDeleteusing namespace std;
FARJANA KAMAL KONOK
201930701
62 BATCH
int main()
{
char op;
float num1, num2;
cout << "Enter operator either + or - or * or /: ";
cin >> op;
cout << "Enter two operands: ";
cin >> num1 >> num2;
switch(op)
{
case '+':
cout << num1+num2;
break;
case '-':
cout << num1-num2;
break;
case '*':
cout << num1*num2;
break;
case '/':
cout << num1/num2;
break;
default:
cout << "Error! operator is not correct";
break;
}
return 0;
}