Hollow Diamond Pattern
Hollow Diamond Pattern
loop. How to print hollow diamond star pattern structure in C program. Logic to
print hollow diamond star pattern in C programming.
Example
Input
Input N: 5
Output
**********
**** ****
*** ***
** **
* *
* *
** **
*** ***
**** ****
**********
Required knowledge
Basic C programming, For loop, Nested loop
**********
**** ****
*** ***
** **
* *
* *
** **
*** ***
**** ****
**********
Here in the upper part of the pattern, trailing and leading stars are inverted
right triangle pattern that can be easily printed. Each row contains 2*rownumber -
2 spaces.
Moving on to the second half, if you look at the trailing and leading stars you
will find that both of them are right triangle star pattern and total number of
spaces per row is 2*rownumber - 2.
#include <stdio.h>
int main()
{
int i, j, n;
printf("Enter value of n : ");
scanf("%d", &n);
printf("\n");
}
printf("\n");
}
return 0;
}
Output
Enter value of n : 5
**********
**** ****
*** ***
** **
* *
* *
** **
*** ***
**** ****
**********