// Sign error
// The number you enter as unsigned is output as signed
// Enter 50000. You get -15536

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
	char s[1024];
	
	printf("Enter the number:\n");
	if (fgets(s, 1024, stdin))
	{
		unsigned short num = strtoul(s, s[1023], 10);
		short d = num;
		printf("You entered: %d\n", d);
	}
	else
		printf("Something went wrong.\n");
}
