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:
- cielo
- Date:
- 2020-04-12
- Revision:
- 25:ca5fce342593
- Parent:
- 24:7f14b70fc9ef
File content as of revision 25:ca5fce342593:
#include <stdio.h> #define letra_a 97 // A EN MINUSCULA #include<iostream> #include<mbed.h> //PARA REPETIR LA SUMA PRESIOAR "a" y luego enter. using namespace std; Serial com1(USBTX,USBRX); // PARA USAR LOS PINES UART int main() { int sum1=0; int num,i,auxcon; char letra; com1.printf("ingrese un numero entero: "); com1.scanf("%d",&num); while (1) { letra=getchar(); if (letra == letra_a) { auxcon=num; for(i=1;i<=5;i++) { auxcon++; sum1=sum1+auxcon; } com1.printf("La suma de los 5 numeros cosecutivos es:%d \n",sum1); } } }