Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- Yances64
- Date:
- 2018-08-28
- Revision:
- 0:9df42b937ac1
- Child:
- 1:7d7dabfcd7ae
File content as of revision 0:9df42b937ac1:
#include "mbed.h"
Serial MESSE(USBTX, USBRX);
int nume1=MESSE.getc();
int nume2=MESSE.getc();
int ope=MESSE.getc();
int resultado=0;
int main(){
MESSE.printf("Ingresa el primer valor a operar""\n");
nume1=MESSE.getc();
MESSE.printf("Ingrese el segundo número a operar""\n");
nume2=MESSE.getc();
MESSE.printf("Ingrese 1 para sumar""\n""2 para restar""\n""3 para multiplicar""\n""4 para dividir""\n");
ope=MESSE.getc();
switch (ope){
case 1:
resultado=nume1+nume2;
MESSE.printf("EL resultado es %resultado");
break;
case 2:
resultado=nume1-nume2;
MESSE.printf("EL resultado es %resultado");
break;
case 3:
resultado=nume1*nume2;
MESSE.printf("EL resultado es ", resultado);
break;
case 4:
resultado=nume1/nume2;
MESSE.printf("EL resultado es %resultado");
break;
default:
MESSE.printf("Inválido");
}
}