Answer to Question #13850 in C++ for Darryl kaye Abella Sanga
Write a program that will display the following pattern, given the value of n.
Example : if n=4, output.
*
**
***
****
1
2012-08-31T08:03:24-0400
#include <iostream>
using namespace std;
int main()
{
int n,i,j;
i=0;
cout<<"enter the number:";
cin>>n;
cout<<"\n";&
while(i<n+1){
for(j=0; j<i; j++){
cout<<"*";
}
i++;
cout<<"\n";
}
cout<<"\n\n";
system("PAUSE");
}
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