patternprogram_402 softethics

Pattern 402

C

#include<stdio.h>
#include<math.h>

int main()
{
  int size=3;
  int i,j,k;
  int p=0;

  for(i=size; i>=-size; i--)
  {
    for(j=1; j<=abs(i); j++)
    {
      printf(" ");
    }


    for(k=size; k>=abs(i); k--)
    {
      printf("%c ",p+65);
    }


    if(i>0)
      p++;
    else
      p--;

    printf("\n");
  }
  return 0;
}

C++

Java

C#

Python

0 0 votes
Rate this Program
Subscribe
Notify of
guest


0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments