C++ programs to print alphabet pattern

Introduction

In this article, I have explained the list of all alphabet pattern programs in c++ programming language. I have used Code::Blocks IDE for debugging purpose. But you can use any C++ programming language compiler as per your availability.

Alphabet pattern : 1

A
BB
CCC
DDDD
EEEEE
#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
  for(i=1;i<=n;i++)
     {
         for(j=1;j<=i;j++)
         {
             cout<<((char)(i+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern : 2

AAAAA
BBBB
CCC
DD
E

#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
  for(i=1;i<=n;i++)
     {
         for(j=i;j<=n;j++)
         {
             cout<<((char)(i+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern : 3

A
AB
ABC
ABCD
ABCDE
#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
  for(i=1;i<=n;i++)
     {
         for(j=1;j<=i;j++)
         {
             cout<<((char)(j+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern : 4

E
DE
CDE
BCDE
ABCDE

#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
   for(i=n;i>=1;i--)
     {
         for(j=i;j<=n;j++)
         {
             cout<<((char)(j+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern : 5

A
BA
CBA
DCBA
EDCBA
#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
    for(i=1;i<=n;i++)
     {
         for(j=i;j>=1;j--)
         {
             cout<<((char)(j+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern : 6

E
ED
EDC
EDCB
EDCBA

#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
   for(i=n;i>=1;i--)
     {
         for(j=n;j>=i;j--)
         {
             cout<<((char)(j+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern 7

E
DD
CCC
BBBB
AAAAA

#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
   for(i=1;i<=n;i++)
     {
         for(j=1;j<=i;j++)
         {
             cout<<((char)(n-i+1+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern 8

EEEEE
DDDD
CCC
BB
A

#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
  for(i=n;i>=1;i--)
     {
         for(j=1;j<=i;j++)
         {
             cout<<((char)(i+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Also check

 All star patterns using C++ programming Language

 List of C++ Language Loop Programs with Examples


Alphabet pattern 9

EDCBA
EDCB
EDC
ED
E

#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
  for(i=1;i<=n;i++)
     {
         for(j=n;j>=i;j--)
         {
             cout<<((char)(j+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern 10

EDCBA
DCBA
CBA
BA
A

#include <iostream>
using namespace std;
int main()
{
 
  int i,j;
  int n=5;
 
   for(i=n;i>=1;i--)
     {
         for(j=i;j>=1;j--)
         {
             cout<<((char)(j+64));
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern 11

#include <iostream>
using namespace std;
int main()
{
  int i,j;
  int n=5;
 
   for(i=1;i<=n;i++)
     {
 
        for(j=1;j<=n-i;j++)
         {
            cout<<" ";
        }
        for(j=1;j<=i;j++)
         {
            cout<<(char)(j+64);
         }
        for(j=i-1;j>=1;j--)
         {
            cout<<(char)(j+64);
         }
 
         cout<<endl;
     }
 
  return 0;
}

Alphabet pattern 12

I
IN
IND
INDI
INDIA

#include <iostream>
using namespace std;
int main()
{
  int i,j;
  char s[]="INDIA";
 
   for(i=0;s[i];i++)
    {
        for(j=0;j<=i;j++)
        cout<<s[j];
 
     cout<<endl;
     }
 
  return 0;
}

Alphabet pattern 13

#include <iostream>
using namespace std;
 
int main()
{
    int i,j,k;
    char c='A';
    int n=5;
 
    for(i=0;i<=n;i++)
    {
       for(j=0;j<=i;j++)
       {
    cout<<" ";
       }
       for(k=n-i-1;k>=0;k--)
       {
           cout<<c;
           c++;
       }
       cout<<endl;
    }
return 0;
}

Alphabet pattern 14

A
BC
DEF
GHIJ
KLMNO

#include <iostream>
using namespace std;
 
int main()
{
  int i,j;
  char c;
  int n=5;
 
  c='A';
  for(i=0;i<n;i++)
   {
   for(j=0;j<=i;j++)
   {
      if(c=='Z')
      break;
 
      cout<<c;
      c++;
   }
 
    cout<<endl;
    }
return 0;
 
}

Alphabet pattern 15

#include <iostream>
using namespace std;
int main()
{
  int i,j;
    char CH='E';
    int space=1;
 
    for(i=1; i<=5; i++)
    {
        for(j='A'; j<=CH; j++)
            cout<<((char)(j));
 
        if(i==1)
           cout<<"\b";
 
        for(j=1; j<space; j++)
            cout<<" ";
 
 
        for(j=CH; j>='A'; j--)
            cout<<((char)(j));
 
        cout<<endl;
        CH--;
        space++;
    }
  return 0;
}

Alphabet pattern 16

A
B C
D E F
G H I J
K L M N O

#include <iostream>
using namespace std;
int main()
{
    int i,j;
    char ch='A';
     for(i=1;i<=5;i++)
    {
        for(j=1;j<=i;j++)
        {
            cout<<ch++;
        }
        cout<<endl;
 
    }
  return 0;
}

Alphabet pattern 17

#include <iostream>
using namespace std;
int main()
{
  int i,j;
  int n=5;
 
   for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-i;j++)
        {
           cout<<" ";
        }
        for(j=i;j>0;j--)
        {
            cout<<((char)(j+64));
        }
        for(j=2;j<=i;j++)
        {
            cout<<((char)(j+64));
        }
        cout<<endl;
    }
  return 0;
}

Alphabet pattern 18

A
B F
C G J
D H K M
E I L N O

#include <iostream>
using namespace std;
int main()
{
  int i,j;
  int n=5;
  int diff,value;
 
    for(i=1;i<=n;i++)
    {
        diff=n-1;
        value=i;
        for(j=1; j<=i; j++)
        {
            cout<<((char)(value+64));
            value=value+diff;
            diff--;
        }
        cout<<endl;
    }
  return 0;
}

Alphabet pattern 19

A
A B C
A B C D E
A B C D E F G
A B C D E F G H I

#include <iostream>
using namespace std;
int main()
{
  int i,j;
  int n=5;
 
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=(i*2-1);j++)
        {
            cout<<((char)(j+64));
        }
        cout<<endl;
    }
  return 0;
}

Alphabet pattern 20

E F G H I
D E F G
C D E
B C
A

#include <iostream>
using namespace std;
int main()
{
  int i,j,k;
  int n=5;
 
     for(i=n;i>=1;i--)
    {
        k = i;
        for(j=1;j<=i;j++,k++)
        {
            cout<<((char)(k+64));
        }
        cout<<endl;
    }
  return 0;
}

Alphabet pattern 21

A B C D E
B C D E
C D E
D E
E

#include <iostream>
using namespace std;
int main()
{
  int i,j;
  int n=5;
 
  for(i=1;i<=n;i++)
    {
        for(j=i;j<=n;j++)
        {
        cout<<((char)(j+64));
        }
 
     cout<<endl;
 
    }
 
  return 0;
}

Alphabet pattern 22

#include <iostream>
using namespace std;
int main()
{
  int i,j,k;
  int n=5;
 
   for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-i;j++)
        {
           cout<<" ";
        }
        for(k=1;k<=i;k++)
        {
            cout<<((char)(i+64));
        }
        cout<<endl;
    }
  return 0;
}

Alphabet pattern 23

#include <iostream>
using namespace std;
int main()
{
  int i,j,k;
  char c='A';
  int n=6;
  for(i=0;i<=n;i++)
  {
    for(j=0;j<=i;j++)
    {
      cout<<" ";
    }
    for(k=n-i-1;k>=0;k--)
    {
      cout<<c;
      c++;
    }
    cout<<endl;
  }
  return 0;
}

Alphabet pattern 24

A
BC
DEF
GHIJ
KLMNO
PQRSTU

#include <iostream>
using namespace std;
int main()
{
  int i,j;
  char c;
  int n=6;
 
  c='A';
  for(i=0;i<n;i++)
  {
    for(j=0;j<=i;j++)
    {
      if(c=='Z')
        break;
      cout<<c;
      c++;
    }
    cout<<endl;
  }
  return 0;
}

 

Leave a Comment