Number Pattern 60 – Rhombus pattern in C programming

Spread the love

Number Pattern 60-Rhombus pattern in C programming

Rhombus pattern in C programming

In this program, we will see the Rhombus pattern numbers in C programming language. Please look into the program.

1
    2   2
  3       3
4           4
  3       3
    2   2
      1

The C program for Pyramid pattern is as follows:

#include <stdio.h>

int main()
{
  int a,b,c;
  for(a=1;a<=4;a++)
  {
    for(b=4;b>=(a-1)*2-1;b--)
      printf(" ");
    printf("%d",a);
    for(b=2;b<=(a-1)*4;b++)
      printf(" ");
    if(a>1)
      printf("%d",a);
    printf("n");
  }
  for(a=3;a>=1;a--)
  {
    for(b=4;b>=(a-1)*2-1;b--)
      printf(" ");
    printf("%d",a);
    for(b=2;b<=(a-1)*4;b++)
      printf(" ");
    if(a>1)
      prantf("%d",a);
    printf("n");
  }
  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