Jair Valdovinos / Mbed 2 deprecated P5_E2

Dependencies:   mbed FXOS8700Q

Committer:
thesad
Date:
Wed Apr 15 21:50:40 2020 +0000
Revision:
1:b6b079534178
Parent:
0:a9edb328dd9c
https://os.mbed.com/users/thesad/code/P4_EJ4/; ;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thesad 0:a9edb328dd9c 1 #include "mbed.h"
thesad 0:a9edb328dd9c 2 #include <stdio.h>
thesad 0:a9edb328dd9c 3 #include <math.h>
thesad 0:a9edb328dd9c 4
thesad 0:a9edb328dd9c 5 Serial com1(USBTX, USBRX);
thesad 0:a9edb328dd9c 6
thesad 0:a9edb328dd9c 7 int potencia(void);
thesad 0:a9edb328dd9c 8
thesad 0:a9edb328dd9c 9
thesad 0:a9edb328dd9c 10 int main()
thesad 0:a9edb328dd9c 11 {
thesad 0:a9edb328dd9c 12 while(1){
thesad 0:a9edb328dd9c 13 int resultado;
thesad 0:a9edb328dd9c 14 resultado = potencia();
thesad 0:a9edb328dd9c 15 com1.printf("El numero elevado a la 10 es: %d \n",resultado);
thesad 0:a9edb328dd9c 16 }
thesad 0:a9edb328dd9c 17 }
thesad 0:a9edb328dd9c 18
thesad 0:a9edb328dd9c 19 int potencia(void)
thesad 0:a9edb328dd9c 20 {
thesad 0:a9edb328dd9c 21 while(1){
thesad 0:a9edb328dd9c 22 int t, b;
thesad 1:b6b079534178 23 com1.printf( "Escriba un número: " ); com1.scanf( "%i", &t );
thesad 0:a9edb328dd9c 24 b = t*t*t*t*t*t*t*t*t*t;
thesad 0:a9edb328dd9c 25 return b;
thesad 0:a9edb328dd9c 26 }
thesad 0:a9edb328dd9c 27 }