#include <iostream>
using namespace std;
int main()
{
float num1,num2;
char m_opr;
cout << "enter num1"<<endl;
cin>>num1;
cout << "enter num2"<<endl;
cin>>num2;
cout<< "enter the operator"<< endl;
cin>>m_opr;
switch(m_opr)
{
case ('+' ):
cout<< num1 + num2 ;
break;
case ( '-'):
cout << num1 - num2;
break;
case ( '*'):
cout << num1 * num2;
break;
case ( '/'):
cout << num1 / num2;
break;
}
return 0;
using namespace std;
int main()
{
float num1,num2;
char m_opr;
cout << "enter num1"<<endl;
cin>>num1;
cout << "enter num2"<<endl;
cin>>num2;
cout<< "enter the operator"<< endl;
cin>>m_opr;
switch(m_opr)
{
case ('+' ):
cout<< num1 + num2 ;
break;
case ( '-'):
cout << num1 - num2;
break;
case ( '*'):
cout << num1 * num2;
break;
case ( '/'):
cout << num1 / num2;
break;
}
return 0;
0 comments:
Post a Comment