You have to think about what you want your program to do. Watch:Compared to what you have:Code:if( x == 1 ) printf( "x is one\n" ); else if( x == 2 ) printf( "x is two\n" ); else printf( "x is not one or two\n" );What is the output of this if x is 1? Is that what you wanted the program to do? You need to think through what you want to do.Code:if( x == 1 ) printf( "x is one\n" ); if( x == 2 ) printf( "x is two\n" ); else printf( "x is not one or two\n" );
Quzah.
Hope is the first step on the road to disappointment.
Output
I see, so the first "if" function and the "else" perform there functions because the code did not clarify what process it wanted to follow?Code:x is one x is not one or two