So today am learning about the signed and unsigned variables. So what i can make out is that signed can have positive, negative and zero values and unsigned can have only the positive values. So to try this through code i wrote this program in c:
#include <stdio.h>
#include <stdlib.h>
void main()
{
int a=-10;
unsigned int x=-4;
printf("signed variable value is : %d\n Unsigned variable value is : %u",a,x);
}
SO as per my expectation output should be like this :
signed variable value is : -10 Unsigned variable value is : 4
But in reality it turned out to be like this:
signed variable value is : -10 Unsigned variable value is : 4294967292
Can any one explain this !!