Angel David Yaguana Hernandez
/
CPP_atof
atof uso y ejemplo
Revision 0:fb7e2db5576a, committed 2012-04-03
- Comitter:
- sherckuith
- Date:
- Tue Apr 03 20:59:22 2012 +0000
- Commit message:
- descripcion de atof
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 fb7e2db5576a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Apr 03 20:59:22 2012 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" +/* atof example: sine calculator */ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + +int main () +{ + double n,m; + double pi=3.1415926535; + char szInput [256]; + printf ( "Enter degrees: " ); + gets ( szInput ); + n = atof ( szInput ); + m = sin (n*pi/180); + printf ( "The sine of %f degrees is %f\n" , n, m ); + return 0; +} \ No newline at end of file
diff -r 000000000000 -r fb7e2db5576a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Apr 03 20:59:22 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479