Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C by Serjio ( 16 years ago )
#include <iostream>
using namespace std;
int main ()
{
float a,b,s=0;
char c;
cout <<"take an expression here"<< endl;
cin>>a;
cin>>c;
cin>>b;
switch (c)
{
case '+':
s=a+b; break;
case '-':
{s=a-b;} break;
case '*':
{s=a*b;} break;
case '/':
{s=a/b;} break;
default: cout<<"an error";
}
cout << s;
return 0;
}
Revise this Paste
Parent: 15530
Children: 15551