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@0:f8d824abdf66, 2020-04-03 (annotated)
- Committer:
- yiato
- Date:
- Fri Apr 03 06:02:07 2020 +0000
- Revision:
- 0:f8d824abdf66
- Child:
- 1:0b9be892ceaf
primer programa publicado
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yiato | 0:f8d824abdf66 | 1 | #include "mbed.h" |
yiato | 0:f8d824abdf66 | 2 | |
yiato | 0:f8d824abdf66 | 3 | //programa que genera una función con argumentos y con retorno de valor |
yiato | 0:f8d824abdf66 | 4 | |
yiato | 0:f8d824abdf66 | 5 | Serial com1(USBTX, USBRX); |
yiato | 0:f8d824abdf66 | 6 | |
yiato | 0:f8d824abdf66 | 7 | int suma(int a, int b); //declaración de funcion |
yiato | 0:f8d824abdf66 | 8 | |
yiato | 0:f8d824abdf66 | 9 | |
yiato | 0:f8d824abdf66 | 10 | int main() |
yiato | 0:f8d824abdf66 | 11 | { |
yiato | 0:f8d824abdf66 | 12 | int suma(int a, int b); |
yiato | 0:f8d824abdf66 | 13 | } |
yiato | 0:f8d824abdf66 | 14 | |
yiato | 0:f8d824abdf66 | 15 | int suma(int a, int b) |
yiato | 0:f8d824abdf66 | 16 | { |
yiato | 0:f8d824abdf66 | 17 | int suma; |
yiato | 0:f8d824abdf66 | 18 | suma= a + b ; |
yiato | 0:f8d824abdf66 | 19 | com1.printf("la suma es igual a; \n") ; |
yiato | 0:f8d824abdf66 | 20 | return (suma); |
yiato | 0:f8d824abdf66 | 21 | } |