C Programming Reference >> C Basic Tutorials >> C Keywords Home >> unsignedui 30/12/06 - Views - Ratings : It is a type modifier applicable to int and char data type. It tells the compiler that first bit of the data type is data bit not sign bit. Int is signed by default while char is unsigned by default. Unsigned variables have double the range of those of signed varaibles but cannot distinguish between positve and negative numbers. Code - void function (void)
{
unsigned int a = 10;
unsigned int b;
b = scanf ("%ud", &b);
printf ("%ud %ud",a, b);
}
|