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.
Diff: main.cpp
- Revision:
- 0:9df42b937ac1
- Child:
- 1:7d7dabfcd7ae
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Aug 28 01:25:47 2018 +0000
@@ -0,0 +1,45 @@
+#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");
+ }
+
+ }