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.
Revision 2:976e71d7270c, committed 2020-04-03
- Comitter:
- yiato
- Date:
- Fri Apr 03 21:22:27 2020 +0000
- Parent:
- 1:0b9be892ceaf
- Commit message:
- ejemplo7
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Apr 03 19:34:28 2020 +0000 +++ b/main.cpp Fri Apr 03 21:22:27 2020 +0000 @@ -4,24 +4,18 @@ Serial com1(USBTX, USBRX); -int suma(int a, int b); //declaración de funcion +int sum(int a, int b); //declaración de funcion int main() { - int suma(int a, int b); + int a=5, b=10, z; + z=sum(a, b); + com1.printf("El resultado es: %d",sum(a,b)); + sum(a,b); } -int suma(int a, int b) +int sum(int a, int b) { - int variable1, variable2, suma; - variable1=10; - variable2=4; - suma= variable1 + variable2 ; - while(1); - { - com1.printf("la suma es igual a %d \n", suma); - wait(1); - } - return (suma); + return (a+b); }