Answer to Question #17068 in C++ for julius bueta

Question #17068
wright a program that will display the following pattern,given the value of n.
Example: if n=4,output
*
* *
* * *
* * * *
1
Expert's answer
2012-10-24T10:50:18-0400

#include<iostream>

#include<conio.h>

using namespace std;

int main()

{

int N;

cout << "Enter any number" << endl;

cin >> N;




do

{

for (int i = 0; i < N; i++) {

cout << "* ";

}

cout << endl;

N--;

} while(N != 0) ;




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