// ForWhile.cc // A for(;;){} is exactly // equivalent to a while(){} #include using namespace std; int main() { int C, CC, A, AA ; { int B=1, BB=0 ; bool CONDITION = true ; A=AA, cout<<"A!" ; while ( CONDITION ) { C=CC, cout<<"C1" ; if(B==0) CONDITION = false ; CC=C, cout<<"C2"; B=BB, cout<<"B!" ; } cout << "\n finished\n" ; } { int B=1, BB=0 ; bool CONDITION = true ; for( A=AA, cout<<"A!" ; CONDITION ; B=BB, cout<<"B!" ) { C=CC, cout<<"C1" ; if(B==0) CONDITION = false ; CC=C, cout<<"C2"; } cout << "\n finished\n" ; } }