0

How to write a program for 1 22 333 4444 55555 vertically downwards

1 22 333 4444 55555 like this

23rd Feb 2018, 7:04 AM
harshal solanki
harshal solanki - avatar
2 Answers
+ 9
#include <iostream> using namespace std; int main() { int n; cin >> n; for(int row=1; row<=_; row++){ for(int col=_; col<=___; col++){ cout << ___; } cout << ____; } return 0; } you have 5 missing parameters fill 'em up ^_^
23rd Feb 2018, 8:30 AM
Burey
Burey - avatar
+ 6
Hint: - Use a nested for loop, outer loop for rows (y), inner loop for columns (x). - The inner loop (x) repetition count follows the outer loop iterator (y) value. - Upon exiting the inner loop, print out a new line so next time inner loop executes, it draws on different line. - I hope you understand the hint. - Good luck : )
23rd Feb 2018, 8:26 AM
Ipang