Star Pattern 9 – Hallow rhombus pattern using stars in C programming

Spread the love

Star Pattern 9-Hallow rhombus pattern using stars in C programming

Hallow rhombus pattern using stars in C programming

In this program, we will see the Hallow rhombus pattern using stars in C programming language. Please look into the program.

*
   * *
  *   *
 *     *
*       *
 *     *
  *   *
   * *
    *

The C program for Cross pattern is as follows:

#include <stdio.h>
int main()
{
    int a, b;
    
    for(a=1; a<=5; a++)
    {
        for(b=5; b>a; b--)
        {
            printf(" ");
        }
      printf("*");
        for(b=1; b<(a-1)*2; b++)
        {
            printf(" ");
        }
        if(a==1) printf("n");
      else printf("*n");
    }
    
    for(a=4; a>=1; a--)
    {
        for(b=5; b>a; b--)
        {
            printf(" ");
        }
      printf("*");
        for(b=1; b<(a-1)*2; b++)
        {
            printf(" ");
        }
        if(a==1) printf("n");
      else printf("*n");
    }    
    getch();
    return 0;
}

Number Series Programs in C programmming

Star Pattern Programs in C programmming

Number Pattern Programs in C programmming

Alphabet Pattern Programs in C programmming


Spread the love

Leave a Comment