Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. main(){
  2.     float n1, n2;
  3.     char oper;
  4.     cout<<"Introduce n1: ";
  5.     cin>>n1;
  6.     cout<<"Introducce n2: ";
  7.     cin>>n2;
  8.     cout<<"Para sumar: '+',restar: '-',dividir: '/', multiplicar: '*' : ";
  9.     cin>>oper;
  10.     switch(oper){
  11.         case '+': cout<<n1+n2; break;
  12.         case '-': cout<<n1-n2; break;
  13.         case '/': cout<<n1/n2; break;
  14.         case '*': cout<<n1*n2; break;
  15.         default: cout<<"No as introducido un operador correcto...";
  16.     }
  17. return  0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement