Find the sizeof() of variables of a given c- code.

#include<stdio.h>

int main()
{
    short int i=20;
    char c=97;
    printf("%d,%d,%d\n",sizeof(i),sizeof(c),sizeof(c+i));
    return 0;
}

(A)2,1,2

(B)2,1,1

(C)2,1,4

(D)2,2,8

how the option are matching?? which is correct??

1Comment
Niket Gangwar @niket151194
19 Aug 2017 02:13 am

All the character variables get converted to integers while performing arithmetic operations or in any other such expression.

Thus the (c+i) expression will become an integer.

Therefore,sizeof(c+i) will return 4...