Está en la página 1de 2

SENTENCIAS Multiples.

#include <stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
using namespace std;
void main(){
int op;
double a,b,res;
do{
system("cls");
cout<<"Menu opciones:"<<endl;
cout<<"1.- Suma:"<<endl;
cout<<"2.- Resta:"<<endl;
cout<<"3.- Multiplicacion:"<<endl;
cout<<"4.- Division:"<<endl;
cout<<"5.- potencia:"<<endl;
cout<<"6.- Salir:"<<endl;
cout<<"Ingrese la opcion:"<<endl;
cin>>op;
switch(op){
case 1:
cout<<"ingrese el primer numero:"<<endl;
cin>>a;
cout<<"ingrese el segundo numero:"<<endl;
cin>>b;
res=a+b;
cout<<"La suma es:"<<res;
break;
case 2:
cout<<"ingrese el primer numero:"<<endl;
cin>>a;
cout<<"ingrese el segundo numero:"<<endl;
cin>>b;
res=a-b;
cout<<"La resta es:"<<res;
break;
case 3:
cout<<"ingrese el primer numero:"<<endl;
cin>>a;
cout<<"ingrese el segundo numero:"<<endl;
cin>>b;
res=a*b;
cout<<"La Multiplicacion es:"<<res;
break;
case 4:
cout<<"ingrese el primer numero:"<<endl;
cin>>a;
cout<<"ingrese el segundo numero:"<<endl;
cin>>b;
res=a/b;
cout<<"La division es:"<<res;
break;
case 5:
cout<<"ingrese el primer numero:"<<endl;
cin>>a;

cout<<"ingrese el segundo numero:"<<endl;


cin>>b;
res=pow (a,b);
cout<<"La Multiplicacion es:"<<res;
}
getch();
}while(op!=6);
}

También podría gustarte