+ 1
C++
How to enter a particular statement n (n with be entered by the user) times using while loop?
2 Answers
+ 4
#include <iostream>
using namespace std;
int main() {
int n = 0;
int i = 0;
cout << "Please enter number of loops: \n";
cin >> n;
while(i < n) {
cout << "A particular statement!\n";
++i;
}
return 0;
}
0
Tks