patternprogram_27 softethics

Pattern 27

C

#include<stdio.h>

int main()
{
  char i,j;

  for(i='A'; i<='E'; i++)
  {
    for(j='A'; j<='E'; j++)
    {
      printf("%c",j);
    }
    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<='E';j++)
 {
 cout<<char(j);
 }
 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 <= 'E'; j++)
      {
        System.out.print(j);
      }
      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 <= 'E'; j++)
      {
        Console.Write(j);
      }
      Console.WriteLine();
    }
    Console.ReadKey(true);
  }
}

Python

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

"""
Another way

for x in 'ABCDE':
 for y in 'ABCDE':
  print(y,end="")
 print()

"""

Tutorial (YouTube)

5 1 vote
Rate this Program
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments