As far as I know, the range for an integer is from -32768 to 32768, right? But take a look at this code:
#include <stdio.h>
main()
{
int n, lar = -32768, count;
for( count = 0 ; count < 10 ; count++ )
{
printf("Please enter your %d integer: ",count+1);
scanf("%d", &n);
if( n >= lar)
lar = n;
}
printf("Largest is %d", lar);
return 0;
}
Eventhough when I entered an integer number out of the range of integer, the compiler still work properly. Why?