Answer to Question #17351 in C++ for mitcha sambajon

Question #17351
write a program that will display the following pattern given the value of n. If n=4, output
1234
123
12
1
1
Expert's answer
2012-10-26T11:12:57-0400
#include <iostream>

#include<conio.h>

using namespace std;

int main()

{

int n;

cout << "Enter n:";

cin >> n;




while (n!= 0){

for (int i = 1; i < n+1; i++){

cout << i;

}

cout << endl;

n--;

}

_getch();

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