// Integer overflow.
// short integer goes up to 32767
// Try adding more than 7!

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

int main()
{
	char s[1024];

	printf("Enter the first number:\n");
	if (fgets(s, 1024, stdin))
	{
		short num = atoi(s);

		short num2 = 32760;
		short num3 = num2 + num;
		printf("The first number is %d:\n", num);
		printf("The second number is %d:\n", num2);
		printf("%d + %d = %d\n", num, num2, num3);
	}
	else
		printf("Something went wrong.\n");
}
