patternprogram_167 softethics

Pattern 167

C

#include<stdio.h>

int main()
{
  int p_height=4;
  int width=p_height*2-1;
  int p_space=p_height-1;
  int i,j,k;



  for (i=p_height-1; i>=0; i--)
  {
    for (j=p_space; j>i; j--)
    {
      printf(" ");
    }
    for (k=1; k<=width; k++)
    {
      printf("%c",i+65); //65 -> ASCII of 'A'
    }
    width-=2;
    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