Jair Valdovinos / Mbed 2 deprecated P5_E2

Dependencies:   mbed FXOS8700Q

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include <stdio.h>
00003 #include <math.h>
00004 
00005 Serial com1(USBTX, USBRX);
00006 
00007 int potencia(void);
00008 
00009     
00010 int main()
00011 {
00012     while(1){
00013     int resultado;
00014     resultado = potencia();
00015     com1.printf("El numero elevado a la 10 es: %d \n",resultado);
00016     }
00017 }
00018 
00019 int potencia(void)
00020 {
00021   while(1){
00022   int t, b;
00023   com1.printf( "Escriba un número: " ); com1.scanf( "%i", &t );
00024   b = t*t*t*t*t*t*t*t*t*t;
00025   return b;
00026     }
00027 }