Analyze this program please and explain which is the right one?
For this code below: int main(int argc, char *argv[]) { int i =1; for (;i<7; i+=2) { i = i*i } cout<<i; } Which one is the right one? Remember, the comparation of current counter value to the terminated value I think should be take place at the top inside for (initVal; terminatedVal; incrementInterval) <--- here the comparation takes place. // version #1 int main(int argc, char *argv[]) { int i =1; for (;i<7;) { cout<<i<<endl; i=i+2; cout<<i<<endl; i=i*i; cout<<i<<endl; } cout<<i; } //version 2 int main(int argc, char *argv[]) { int i =1; for (;i<7;) { cout<<i<<endl; i=i*i; cout<<i<<endl; int main(int argc, char *argv[]) { int i =1; for (;i<7;) { cout<<i<<endl; i=i+2; cout<<i<<endl; i=i*i; cout<<i<<endl; } cout<<i; } } cout<<i; } Thank you all.