You need% d to print an integer and% c to print a char in C
http://www.cplusplus.com/reference/cstdio/printf/
Look at the expression below
printf("%c ",numbers[n]);
You use% c to print int, which is incorrect.
To be specific, printf was borrowed from C and has some limitations. The most common printf restriction mentioned is type safety, as it relies on the programmer to correctly match the format string with the arguments. The second limitation that comes back from the varargs environment is that you cannot extend the behavior with user-defined types. Printf knows how to print a set of types, and all that you choose from it. However, for some things for which it can be used, it is faster and easier to format lines with printf than with C ++ streams.
source share