For Loop in C++

By: Prof. Fazal Rehman Shamil
Last modified on October 3rd, 2019

For Loop in C++

For loop have three parts;

for (i= 1; i <= n; ++i)

loop initialization: e.g i=1;

loop condition: e.g i<=n;

loop increment/decrement: e.g i++;

Example of For loop

 

Prof. Fazal Rehman Shamil