+ 1

What is the best practice for learning c++ loops?

hello every body, i m in 12 grade and currently, we r studying loops, but it seems something ghost language😂😂. i want to know what is the best practice for learning loops... thanks in advance😊😊

16th Jan 2018, 2:04 PM
kashif ahmad
kashif ahmad - avatar
2 Answers
+ 7
The best way to learn loops in my opinion is what we call as "Dry Run" Now what this "Dry Run" really is? Well, it is simply manual compilation. It means you have to analyse how looping really works step by step. Now let us consider a simple example int i; for(i=0;i<10;i++) cout<<i; Step 1: variable i is intialized as 0 Step 2: then it checks i<10 which is true since 0 is < 10 Step 3: prints the value of i Step 4: increments value by one (i++) Now this process continues untill the condition becomes false. i.e. i becomes 10 ( 10<10 is false) and the loop ends after this. Hope this helped u!
16th Jan 2018, 3:29 PM
Abhishek Tandon
Abhishek Tandon - avatar
+ 2
it helped me
16th Jan 2018, 4:05 PM
Shivam Raj
Shivam Raj - avatar