+ 3
Output for code - turbo c++
I know turbo c++ is not taught here, but it is taught in my school. I came across this question : find the output and number of times the code runs: for(int I=0;i<30;i++) { if(i%5) cout<<++I<<endl; else if(i%3==2) cout<<i+5<<endl; else if(i%2==0) cout<<++i<<i++<<endl; else i+=5; }
6 Answers
+ 11
@S V Shanmugha Balan
I'm aware. It's regretful to know that some schools still worship TCC. This just shows that those in charge of your education either still live in the past and believe that the latest version of Android is Eclair, or has no idea at all what being a programmer is about.
I'm just here to remind you that it is important to learn standard C++ (alongside Turbo C++, if inevitable). If the question you posted is an academic one, whoever created it should be prosecuted - There is never a standard answer to it, and never will you in any practical situation use such code in your projects.
+ 9
It would be a great idea to stay updated.
https://www.sololearn.com/Discuss/288609/?ref=app
Also, the above code results in undefined behaviour. Refer: https://stackoverflow.com/questions/4176328/undefined-behavior-and-sequence-points
+ 6
also you code will have errors
look at the conditional statemenst in the c++ course
copy the if else code by hand or typing.
- you should find the mistake
+ 3
yes I already sent a post abt tcc and SL playground and if I remember right u answered it but my school says "LEARN TCC OR ELSE...."
+ 3
tq guys lol @Hatsy Rei