Skip to content

Commit ad27310

Browse files
committed
solve 1st problem of while loop in C++
1 parent 50f9961 commit ad27310

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

.cpp

Whitespace-only changes.

Print1toN_while.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// ================================================
2+
// Language: C++ / Cpp
3+
// Topic : [While loop]
4+
// Problem : 👉👉 [1]
5+
// Want : Print1toN_while.cpp
6+
//
7+
// ================================================
8+
#include <iostream>
9+
using namespace std;
10+
int main(){
11+
int n ;
12+
cout<<"Enter Number " ;
13+
cin>> n;
14+
int i = 1 ;
15+
while(i<=n){
16+
cout << i << " " << endl;
17+
i++;
18+
19+
}
20+
return 0 ;
21+
}

a.out

16.3 KB
Binary file not shown.

extra.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// ================================================
2+
// Language: C++ / Cpp
3+
// Topic : [ForLoop]
4+
// Problem : 👉👉 [1]
5+
// Want :
6+
//
7+
// ================================================
8+
#include <iostream>
9+
using namespace std;
10+
int main(){
11+
return 0 ;
12+
}

0 commit comments

Comments
 (0)