+ 1

How to make c++ program by using loop to print:

1 12 123 1234 12345

16th Nov 2016, 11:46 AM
Yash Kumar
Yash Kumar - avatar
1 Answer
+ 1
#include <iostream> using namespace std; int main() { int i,j; for(i=0;i<5;i++) { for(j=5;j>i;j--) { cout << " "; } for(j=1;j<=i+1;j++) { cout << j; } cout << "\n"; } return 0; }
16th Nov 2016, 12:21 PM
Aditya kumar pandey
Aditya kumar pandey - avatar