Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions for/src/for.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
// Author : John Purcell
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
// Description : for looping statement
//============================================================================

#include <iostream>
using namespace std;

// for is a looping statement. Loop statements are used to execute a set of instructions repeated number of times till the time a condition is met .
int main() {

for (int i = 0; i < 10; i++) {
for (int i = 0; i < 10; i++) // The syntax of for loop is - for( initialising_statement ; condition ; update expression for looping variable (i in this case))
{

cout << "Hello " << i << endl;
cout << "Hello " << i << endl; // This is the body of the loop ^^
}

return 0;
Expand Down