Answer to Question #17068 in C++ for julius bueta
wright a program that will display the following pattern,given the value of n.
Example: if n=4,output
*
* *
* * *
* * * *
1
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment