C examples for Language Basics:scanf
To input an unsigned integer, use the %u format specifier. For example,
#include <stdio.h> int main(void) { unsigned num;//from ww w . j a v a2 s . com scanf("%u", &num); printf("%u", num); return 0; }