Pattern 65

Pattern 65 post thumbnail image

C

#include<stdio.h>

int main()
{
  char i,j;

  for(i='A'; i<='E'; i++)
  {
    for(j='A'; j<=i; j++)
    {
      printf("%c",i);
    }
    printf("\n");
  }
  return 0;
}

C++

 #include<iostream.h>
 
 int main()
 {
 char i,j;
 
 for(int i ='A';i<='E';i++)
 {
 for(int j ='A';j<=i;j++)
 {
 cout<<char(i);
 }
 cout<<endl;
 }
 return 0;
 }

Java

     class PatternProg
     {
     public static void main(String args[])
     {
     char i;
     char j;
      
     for (i = 'A';i <= 'E';i++)
     {
     for (j = 'A';j <= i;j++)
     {
     System.out.print(i);
     }
     System.out.print("\n");
     }
      
     }
 }

C#

using System;

class PatternProg
{
  public static void Main()
  {
    char i;
    char j;

    for (i = 'A'; i <= 'E'; i++)
    {
      for (j = 'A'; j <= i; j++)
      {
        Console.Write(i);
      }
      Console.WriteLine();
    }
    Console.ReadKey(true);
  }
}

Python

for x in range(65, 70):
    for y in range(65, x + 1):
        print(chr(x), end="")
    print()

Tutorial (YouTube)

0 0 votes
Rate this Program
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Related Patterns