Skip to content

Commit b37b539

Browse files
added tutorial 10 cpp file from local machine
1 parent c637d6a commit b37b539

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

tut10.cpp

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
7+
/* Loops in c++
8+
There are three types of loops in C++ :
9+
1.) For loop
10+
2.) While loop
11+
3.) Do-While loop
12+
*/
13+
14+
/********For Loop in C++*********/
15+
// int n;
16+
// cin>>n;
17+
// for (int i = 1; i <= n; i++)
18+
// {
19+
// cout<<i<<endl;
20+
// }
21+
22+
/********Do - While Loop in C++*********/
23+
// Question: Print numbers from 1 to 5 then 10 to 15 then 20 to 25.
24+
25+
// for (int i = 1; i <= 25; i++)
26+
// {
27+
// if (i >= 1 && i <= 5)
28+
// {
29+
// cout << i << endl;
30+
// }
31+
// if (i >= 10 && i <= 15)
32+
// {
33+
// cout << i << endl;
34+
// }
35+
// if (i >= 20 && i <= 25)
36+
// {
37+
// cout << i << endl;
38+
// }
39+
// }
40+
41+
// while (i<=5)
42+
// {
43+
// cout<<i<<endl;
44+
// }
45+
46+
// while (i>=10 && i <= 15)
47+
// {
48+
// cout<<i<<endl;
49+
// }
50+
51+
// while (i>= 20 && i <= 25)
52+
// {
53+
// cout<<i<<endl;
54+
// }
55+
56+
57+
// multiplication table for 6
58+
// int i = 1;
59+
// while (i <= 10)
60+
// {
61+
// cout << i * 6 << endl;
62+
// i++;
63+
// }
64+
65+
return 0;
66+
}
67+
68+
/*
69+
* * * * *
70+
* *
71+
* *
72+
* *
73+
* * * * *
74+
75+
*
76+
* *
77+
* * *
78+
* * * *
79+
* * * * *
80+
81+
* * * * *
82+
* * * *
83+
* * *
84+
* *
85+
*
86+
87+
*/

0 commit comments

Comments
 (0)