patternprogram_160 softethics

Pattern 160

C

#include<stdio.h>

#include<math.h>
int main()
{
  int n=5;  //size;
  int z=1,l=1;
  int i,j,k;

  for(i=0; i<5; i++)
  {
    for(j=4; j>i; j--)
    {
      printf(" ");
    }
    for(k=1; k<=z; k++)
    {
      printf("%c",abs(k-l)+65);
    }
    l++;
    z+=2;
    printf("\n");
  }
  return 0;
}

C++

Java

C#

Python

Tutorial (YouTube)

0 0 votes
Rate this Program
Subscribe
Notify of
guest


0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments