Gabriel Aviña
/
Tarea4_Ejercicio2
Hola
Revision 0:6c12d390de03, committed 2014-04-10
- Comitter:
- elchef
- Date:
- Thu Apr 10 01:53:03 2014 +0000
- Commit message:
- Hola;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 6c12d390de03 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 10 01:53:03 2014 +0000 @@ -0,0 +1,23 @@ +//Gabriel Ivan López Aviña A01223680 +//Juan Carlos Verduzco Gastélum A01112580 +#include "mbed.h" +Serial pc(USBTX, USBRX); + +struct numero{ + float entero; + float decimal; + }numero1; + +void division(float cifra, numero *numero2){ + int temporal = cifra; + numero2 -> entero = temporal; + numero2 -> decimal = fmod(cifra, numero2 -> entero); +} + +int main(){ + float valor = 15.5; + division (valor, &numero1); + pc.printf("Entero %f \n",numero1.entero); + pc.printf("Decimal %f \n",numero1.decimal); + return 0; +} \ No newline at end of file
diff -r 000000000000 -r 6c12d390de03 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Apr 10 01:53:03 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e \ No newline at end of file