64 506
Assignments Done
99,1%
Successfully Done
In September 2018

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

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions