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
Expert's answer
#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 first!

Leave a comment

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal