1. Both can be used, because both variables C 1 and C2 can store the ASCII value of the input character, whether it is defined as character char or integer int.
We should use printf function. We know that putchar only outputs characters, so we can use printf("%d%d ",c 1, C2); The ASCII value of the output variable.
It can't be replaced unconditionally. First of all, the two types occupy different memory sizes. Char takes up 1 byte, and int usually takes up 4 bytes. If you need to store large integers, you can only use int type, otherwise there will be overflow problems. So we should decide which type to use according to the specific situation.