#include<stdio.h>
int main()
{
unsigned short int x=-10;
short int y=-10;
unsigned int z=-10000000;
int m=-10000000;
printf("x=%d y=%d z=%d m=%d",x,y,z,m);
return 0;
}
output=x=65526 y=-10 z=-10000000 m=-10000000
My query is How unsigned short int
differ from unsigned int
in the scenario of data holding. i.e x=65526 where as z=-10000000 why x is not equal -10 where as z can hold any data
As short is 2 byte so twos complement -10 is 65526
but why not same in case
of z