63 063
Assignments Done
99,1%
Successfully Done
In July 2018

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

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions