diff options
Diffstat (limited to 'i_vs_d_printf_scanf.c')
-rw-r--r-- | i_vs_d_printf_scanf.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/i_vs_d_printf_scanf.c b/i_vs_d_printf_scanf.c new file mode 100644 index 0000000..c93166c --- /dev/null +++ b/i_vs_d_printf_scanf.c @@ -0,0 +1,15 @@ +#include <stdio.h> + +int main() +{ + int a, b, c, d, e; + + printf("scanf using %%i: "); + e = scanf("%i %i %i %i", &a, &b, &c, &d); + printf("%%i: %i, %%d: %d, %%i: %i, %%d: %d, e: %d\n\n",a,b,c,d,e); + + printf("scanf using %%d: "); + e =scanf("%d %d %d %d", &a, &b, &c, &d); + printf("%%i: %i, %%d: %d, %%i: %i, %%d: %d, e: %d\n\n",a,b,c,d,e); + return 0; +} |