Andres Gaffs
/
Tarea_apuntadores2
Apuntadores ejercicio 2
Revision 0:2083a7871209, committed 2014-04-24
- Comitter:
- AndresGaffS
- Date:
- Thu Apr 24 01:07:27 2014 +0000
- Commit message:
- apuntadores ejercicio 2
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 24 01:07:27 2014 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +Serial pc(USBTX, USBRX); + +struct numero{ + float entero; + float decimal; + }numeros; + +void desglosador(float digito, numero *numero2){ // Funcion para desglozar la parte entera de la decimal + int variable = digito; + numero2 -> entero = variable; + numero2 -> decimal = fmod(digito, numero2 -> entero); +} + +int main(){ + float valor = 15.5; + desglosador (valor, &numeros); + pc.printf("Entero %f \n",numeros.entero); + pc.printf("Decimal %f \n",numeros.decimal); + return 0; +} + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Apr 24 01:07:27 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e \ No newline at end of file