Posted by : Unknown
Wednesday, February 3, 2016
Ans:
#include <stdio.h>
int main()
{
int i, j, n;
//Reads number of rows from user
printf("Enter value of n: ");
scanf("%d", &n);
//Iterates over each row
for(i=1; i<=n; i++)
{
//Prints leading spaces before *
for(j=1; j<i; j++)
{
printf(" ");
}
for(j=1; j<=n; j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
Related Posts :
- Back to Home »
- Star Patterns »
- 37.Mirrored Rhombus using *'s as shown below.