Hello I was doing a home work assignment for my C programming class and I came across a problem. The assignment is a simple program that demonstrates how to use the "continue" statement.
I am coding on a linux laptop with gnu gcc 3.3.6, I found that when I compile it under gcc I get the wrong output, instead of skip printing the number 5 it prints it, and also never prints the last printf statement. When I compile it on a windozs box with Dev++ 4 from Bloodshed the same code runs with the correct output. Can anybody explain why this would be? I know they are two different compilers, but its a C statement shouldn't be the same for both.Code:// Fig. 4.12 fig04_12.c // Using the continue statement in a for statement #include <stdio.h> int main() { int x; for ( x = 1; x <= 10; x++ ) { if ( x == 5 ) { continue; } printf ( "%d ", x ); } printf ( "\nUsed continue to skip printing the valve 5\n" ); return 0; }