Angel David Yaguana Hernandez
/
CPP_scanf
scanf, descripcion y ejemplo
Revision 0:21bcb4522e4e, committed 2012-04-03
- Comitter:
- sherckuith
- Date:
- Tue Apr 03 21:03:42 2012 +0000
- Commit message:
- scanf, descripcion y ejemplo
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 21bcb4522e4e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Apr 03 21:03:42 2012 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +/* scanf example */ +#include <stdio.h> + +int main () +{ + char str [80]; + int i; + + printf ("Enter your family name: "); + scanf ("%s",str); + printf ("Enter your age: "); + scanf ("%d",&i); + printf ("Mr. %s , %d years old.\n",str,i); + printf ("Enter a hexadecimal number: "); + scanf ("%x",&i); + printf ("You have entered %#x (%d).\n",i,i); + + return 0; +} +
diff -r 000000000000 -r 21bcb4522e4e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Apr 03 21:03:42 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479