forked from codebloded/BackToBasics.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloops.cpp
More file actions
41 lines (33 loc) · 722 Bytes
/
loops.cpp
File metadata and controls
41 lines (33 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<iostream>
using namespace std;
int main()
{
/*There are 3 types of loops in C++
1.Entry Controlled loop
a.For loop
b. While loop
2. Exit controlled loop
a. do-while loop
*/
//******************FOR LOOP***************
for(int i=0; i<=12; i++)
{
cout<<"Hello world "<<i<<endl;
}
// *********WHILE LOOP***********
int iter =0;
while(iter<19)
{
cout<<"Hey this is iter"<<iter<<endl;
iter++;
}
return 0;
// **************DO WHILE LOOP**************
int c = 23;
do
{
cout<<"This is excecute at least one time either the condition is true or false ";
c++;
}
while(c>50);
}