Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main(){
- float n1, n2;
- char oper;
- cout<<"Introduce n1: ";
- cin>>n1;
- cout<<"Introducce n2: ";
- cin>>n2;
- cout<<"Para sumar: '+',restar: '-',dividir: '/', multiplicar: '*' : ";
- cin>>oper;
- switch(oper){
- case '+': cout<<n1+n2; break;
- case '-': cout<<n1-n2; break;
- case '/': cout<<n1/n2; break;
- case '*': cout<<n1*n2; break;
- default: cout<<"No as introducido un operador correcto...";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement