Chew Code | Guide to Computer Programming Basics

Get C++ Tutorials, Projects, Practicals, Practice Papers for CBSE Class 12 & 11.

Basics of FOR loop in C++ for CBSE class 11 & 12

We have 3 types of loop in C++ : for loop, while loop and the do-while loop. In the previous post, we had discussed the basics of the while and do-while loop. Now let us see what a ‘for loop‘ is and how it works. Like all other loops, for loop also executes a statement or a group of statements repeatedly. Its syntax is: for(initialization expression,test expression,increment expression) { statement(s); ...

Basics of While & Do-While Looping Constructs in C++

Loops are a very important part of any programming language. They provide the facility of iteration in our code. In other words, whenever we wish to execute a group of statements more than one time, loops come in handy. Both the while and do while loops execute a statement or a group of statements repeatedly if a particular condition is satisfied. So all you need is a condition to be evaluated and, of course,...