Mega Code Archive

 
Categories / C / Console
 

Read unsigned int, long and short from console

#include <stdio.h> int main(void) {   unsigned u;   long l;   short s;    printf("Enter an unsigned: ");   scanf("%u", &u);       printf("Enter a long: ");   scanf("%ld", &l);      printf("Enter a short: ");   scanf("%hd", &s);   printf("Here are they: %u %ld %hd\n", u, l, s);   return 0; }