We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50cb62e commit 53856b9Copy full SHA for 53856b9
ForLoop.cpp
@@ -0,0 +1,41 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+int main()
5
+{
6
+ int n;
7
+ cout << "Enter the no. ";
8
9
+ cin >> n;
10
11
+ /*
12
+ for (int i = 1; i <= n; i++)
13
+ {
14
+ cout << i << endl;
15
+ }
16
+ */
17
18
+ int i = 1;
19
+ for (;;)
20
21
+ if (i <= n)
22
23
24
25
+ else
26
27
+ break;
28
29
30
+ i++;
31
32
33
+ cout << endl;
34
35
+ for (int a = 0, b = 2; a < n && b < n; a++, b++)
36
37
+ cout << a << " " << b << endl;
38
39
40
+ return 0;
41
+}
0 commit comments