Answer to Question #42592 in C++ for omar yasser

Question #42592
write a program in c++ to make the following pattern 123456
12345
1234
123
12
1
1
Expert's answer
2014-05-22T09:15:04-0400
#include <iostream>
using namespace std;
void PrintPattern(int n) {
for (int i=n; i >= 1; --i) {
for (int k=1; k <= i; ++k) {
cout << k;
}
cout << endl;
}
}
int main() {
PrintPattern(6);
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS