Answer to Question #13850 in C++ for Darryl kaye Abella Sanga

Question #13850
Write a program that will display the following pattern, given the value of n.
Example : if n=4, output.
*
**
***
****
1
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS