Program all natural number from 1 to n using while loop
#include <iostream> using namespace std; int main() { int i, n; cin >> n; i = 1; while (i<=n) { cout << i << endl; i++; } return 0; }
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment