what happened when I use %d in printf() to display a long int or unsigned number? consider the code below:
#include<stdio.h>
int main(void)
{
unsigned un=40000;
printf("un=%u and not %d",un,un);
return 0;
}
and what I get is "un=40000 and not -25536", what was going on here?
thanks for help.
#include<stdio.h>
int main(void)
{
unsigned un=40000;
printf("un=%u and not %d",un,un);
return 0;
}
and what I get is "un=40000 and not -25536", what was going on here?
thanks for help.