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@2:976e71d7270c, 2020-04-03 (annotated)
- Committer:
- yiato
- Date:
- Fri Apr 03 21:22:27 2020 +0000
- Revision:
- 2:976e71d7270c
- Parent:
- 1:0b9be892ceaf
ejemplo7
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 | 2:976e71d7270c | 7 | int sum(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 | 2:976e71d7270c | 12 | int a=5, b=10, z; |
| yiato | 2:976e71d7270c | 13 | z=sum(a, b); |
| yiato | 2:976e71d7270c | 14 | com1.printf("El resultado es: %d",sum(a,b)); |
| yiato | 2:976e71d7270c | 15 | sum(a,b); |
| yiato | 0:f8d824abdf66 | 16 | } |
| yiato | 0:f8d824abdf66 | 17 | |
| yiato | 2:976e71d7270c | 18 | int sum(int a, int b) |
| yiato | 0:f8d824abdf66 | 19 | { |
| yiato | 2:976e71d7270c | 20 | return (a+b); |
| yiato | 0:f8d824abdf66 | 21 | } |