Advertisement

Numbers of 1st half Diamond

#include<stdio.h>
#include<conio.h>
int main()
{
      int i,j,k,a,x;
      printf("enter the number of diamond=");
      scanf("%d",& a);
      for(x=1;x<=a;x++)
      {
         for(i=1;i<=5;i++)
            {
                 for(k=1;k<=5-i;k++)
                 printf(" ");
      for(j=1;j<=2*i-1;j++)
      {
      printf("*");
      }
      printf("\n");
      }
      }
      getch();
      }

No comments:

Post a Comment

Please comment bellow. Share your knowledge