#include #include #include int main() { printf("=======Start of A========\n"); int i=0; for(;i>=0;i++) ; printf("%d\n",i); // explanation: the range of int is [INT_MIN, INT_MAX] or [ -2147483648, 2147483647] // The loop appears to be infinite but when i=MAX_INT, i++ makes it // wrap around and become the smalles negative int value. // At that point the loop ends and the program printf -2147483648. // It takes a while to count up to INT_MAX, though. printf("======= End of A ========\n"); printf("DEBUG: INT_MAX=% d\n", INT_MAX); printf("DEBUG: INT_MIN=% d\n", INT_MIN); printf("=======Start of B========\n"); int a,b; for(a=0; a<=5; a++) { for(b=0; b<=5; b++) if( (a==1) || (a==4)) printf("#"); else if((b==1) || (b==4)) printf("#"); else printf(" "); printf("\n"); } printf("======= End of B ========\n"); system("pause"); }