patternprogram_297 softethics

Pattern 297

C

#include <stdio.h>
int main()
{
  int n=5; //size
  int i,j;

  for(i=n; i>=1; i--)
  {
    for(j=1; j<=i; j++)
    {
      if(i%2==0)
        printf("%c",i+64); // to get character
      else
        printf("%d",i);
    }
    printf("\n");
  }
}

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