Write a C Program to Print Rhombus Star Pattern using the C language for loop. The main loop in this example iterates from the last row to the first, and nested for loops prints the rhombus pattern.
#include<stdio.h>
int main()
{
int i, j, k, rows;
printf("Enter Rhombus Star Pattern Rows = ");
scanf("%d", &rows);
printf("Rhombus Star Pattern\n");
for(i = rows; i >= 1; i--)
{
for(j = 1; j <= i - 1; j++)
{
printf(" ");
}
for(k = 1; k <= rows; k++)
{
printf("*");
}
printf("\n");
}
return 0;
}
For more star pattern examples, please refer to the C Star Pattern Programs article.

This C Program uses the C language while loop allows entering a symbol and printing that symbol in Rhombus Pattern.
#include<stdio.h>
int main()
{
int i, j, k, rows;
char ch;
printf("Symbol for Rhombus Pattern = ");
scanf("%c", &ch);
printf("Enter Rhombus Star Pattern Rows = ");
scanf("%d", &rows);
printf("\n");
i = rows;
while(i >= 1)
{
j = 1;
while(j <= i - 1)
{
printf(" ");
j++;
}
k = 1;
while(k <= rows)
{
printf("%c", ch);
k++;
}
printf("\n");
i--;
}
return 0;
}
Symbol for Rhombus Pattern = #
Enter Rhombus Star Pattern Rows = 9
#########
#########
#########
#########
#########
#########
#########
#########
#########
Also Read