Just looking the signed and unsigned instructions, to be simple, unsigned is for numbers that are positive ONLY, and the signed is for negative numbers. This instructions goes before the data type, example, unsigned int. Here's an example code.
#include <stdio.h>
main()
{
int st;
signed int nd;
unsigned int rd;
st = -1;
nd = -2;
rd = 3;
printf("The first number is %d", st);
getchar();
printf("The second number is %d", nd);
getchar();
printf("The third number is %d", rd);
getchar();
}
No comments:
Post a Comment