#include
int main()
{
short int i = 20;
char c = 97;
printf(\"%d, %d, %d\\n\", sizeof(i), sizeof(c), s
The data type of a is "short int". -32768 ~ +32767
The data type of c is "char". 0 ~ 255
When you add a to c it is not either short int nor char, it becomes int!
Here is is an example code which help you to get the variable data type:
#include
int main()
{
short int a = 1;
char c = 'A';
std::cout << typeid(a + c).name() << std::endl;
return 1;
}