63 057
Assignments Done
99,1%
Successfully Done
In July 2018

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

Question #17128
wright a program that will display the following pattern,given the value of n.
Example: if n=4,output
*
* *
* * *
* * * *
Expert's answer
#include<iostream>

#include<conio.h>

using namespace std;

void main()

{

int i,j,k,n;

printf("Enter the value of n: ");

scanf("%d",&n);

for(i=1;i<=n;i++)

{

for(k=1;k<=n-i;k++)

printf(" ");




for(j=1;j<=2*i-1;j++)

{

printf("*");

}

printf("
");

}

_getch();

}

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