c++ for loop syntax
for(int i =0; i<6;++i){//initialize;condition;updation cout<<i<<endl;//code block }//first it initializes, then checks the condition, then runs the code block and at last updates 'i'
c++ for loop
for (initialization; condition; update) { // body of-loop }
define for loop c++
#define FOR(x,a,b) for(int x = a; x <= b; x++) #define FOD(x,a,b) for(int x = a; x >= b; x--) #define REP(x,a,b) for(int x = a; x < b; x++) #define RED(x,a,b) for(int x = a; x > b; x--)
c++ for loops
#include <iostream> #define FOR(i,a) for (int i = 0; i < a; i++) FOR(i, 3) cout << i << endl;
loop in c++
out << size;
Source: leetcode.com