Skip to content

Commit 5632996

Browse files
committed
loops: forloop
learn how to loop a process using for loop
1 parent 73e2d0d commit 5632996

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

loops/forloop.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* learn to loop a process using for loop
3+
*/
4+
5+
#include <iostream>
6+
7+
int main()
8+
{
9+
/**
10+
* what this for loop will do??
11+
* this will store integer x as 1
12+
* it will increment it by 1 till it reaches 20 :)
13+
*/
14+
15+
for (int a = 1; a < 20; a = a + 1) {
16+
std::cout << "value of a: " << a << std::endl;
17+
}
18+
19+
return 0;
20+
}

0 commit comments

Comments
 (0)