Alphabet Pattern

Cpp program to print triangle alphabet pattern

Cpp program to print triangle alphabet pattern

In this tutorial, we will discuss a concept of Cpp program to print triangle alphabet pattern using for loop in C++ language.

here, we displayed 15 alphabet Floyd’s triangle program with coding and using nested for loop and also we get input from user using cin function.

the user can provide numbers as they wish and get the alphabet pattern according to their input

Java program to display triangle alphabet pattern

Pattern programs

Floyd’s Triangle Alphabet Pattern 1

Program 1

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter number of rows: ";
    cin>>rows;
    cout << "\nHere your pattern\n\n";
    for(i=1; i<=rows; i++){
        for(j=1; j<=i; j++){
        cout<<((char)(i+64));
    }
    cout<< endl;
    }
getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter number of rows: 6

Here your pattern

A
BB
CCC
DDDD
EEEEE
FFFFFF

Floyd’s Triangle Alphabet Pattern 2

Program 2

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter number of rows: ";
    cin>>rows;
    cout << "\nHere your pattern\n\n";
    for(i=1; i<=rows; i++){
        for(j=1; j<=i; j++){
        cout<<((char)(j+64));
    }
    cout<< endl;
    }
getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter number of row: 6

Here your pattern

A
AB
ABC
ABCD
ABCDE
ABCDEF

 

Floyd’s Triangle Alphabet Pattern 3

Program 3

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter number of rows: ";
    cin>>rows;
    cout << "\nHere your pattern\n\n";
    for(i=1; i<=rows; i++){
        for(j=i; j<=rows; j++){
        cout<<((char)(i+64));
    }
    cout<< endl;
    }
getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter your number of rows: 6

Here your pattern

AAAAAA
BBBBB
CCCC
DDD
EE
F

 

Floyd’s Triangle Alphabet Pattern 4

Program 4

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter the number of rows:" << endl;
    cin>>rows;
    cout<<"\n";
    cout<<"Here, your pattern\n";

    for(i=1; i<=rows; i++){
        for(j=i; j>=1; j--){
        cout<<((char)(j-1+65));
    }
    cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows:
6

Here, your pattern
A
BA
CBA
DCBA
EDCBA
FEDCBA

 

Floyd’s Triangle Alphabet Pattern 5

Program 5

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter the number of rows:" << endl;
    cin>>rows;
    cout<<"\n";
    cout<<"Here, your pattern\n";

    for(i=rows; i>=1; i--){
        for(j=i; j<=rows; j++){
        cout<<((char)(j+64));
    }
    cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows:
6

Here, your pattern
F
EF
DEF
CDEF
BCDEF
ABCDEF

 

Floyd’s Triangle Alphabet Pattern 6

Program 6

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter the number of rows:" << endl;
    cin>>rows;
    cout<<"\n";
    cout<<"Here, your pattern\n";

    for(i=rows; i>=1; i--){
        for(j=rows; j>=i; j--){
        cout<<((char)(j+64));
    }
    cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows:
6

Here, your pattern
F
FE
FED
FEDC
FEDCB
FEDCBA

 

Floyd’s Triangle Alphabet Pattern 7

Program 7

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter the number of rows:" << endl;
    cin>>rows;
    cout<<"\n";
    cout<<"Here, your pattern\n";

    for(i=rows; i>=1; i--){
        for(j=1; j<=i; j++){
        cout<<((char)(j+64));
    }
    cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows:
6

Here, your pattern
ABCDEF
ABCDE
ABCD
ABC
AB
A

 

Floyd’s Triangle Alphabet Pattern 8

Program 8

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter the number of rows" << endl;
    cin>>rows;
    cout << "\nHere your pattern\n" << endl;
    for(i=1; i<=rows; i++){
        for(j=1; j<=i; j++){
            cout<<((char)(rows-i+1+64));
        }
        cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows
6

Here your pattern

F
EE
DDD
CCCC
BBBBB
AAAAAA

 

Floyd’s Triangle Alphabet Pattern 9

Program 9

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter the number of rows" << endl;
    cin>>rows;
    cout << "\nHere your pattern\n" << endl;
    for(i=rows; i>=1; i--){
        for(j=1; j<=i; j++){
            cout<<((char)(i+64));
        }
        cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows
6

Here your pattern

FFFFFF
EEEEE
DDDD
CCC
BB
A

 

Floyd’s Triangle Alphabet Pattern 10

Program 10

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter the number of rows" << endl;
    cin>>rows;
    cout << "\nHere your pattern\n" << endl;
    for(i=1; i<=rows; i++){
        for(j=rows; j>=i; j--){
            cout<<((char)(j+64));
        }
        cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows
6

Here your pattern

FEDCBA
EDCBA
DCBA
CBA
BA
A

 

Floyd’s Triangle Alphabet Pattern 11

Program 11

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    cout << "Enter the number of rows" << endl;
    cin>>rows;
    cout << "\nHere your pattern\n" << endl;
    for(i=rows; i>=1; i--){
        for(j=i; j>=1; j--){
            cout<<((char)(j+64));
        }
        cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows
6

Here your pattern

FEDCBA
EDCBA
DCBA
CBA
BA
A

 

Floyd’s Triangle Alphabet Pattern 12

Program 12

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows;
    char alphabet='A';
    cout << "Enter the number of rows" << endl;
    cin>>rows;
    cout << "\nHere your pattern\n" << endl;
    for(i=1; i<=rows; i++){
        for(j=1; j<=i; j++){
            cout<<alphabet++;
        }
        cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows
6

Here your pattern

A
BC
DEF
GHIJ
KLMNO
PQRSTU

 

Floyd’s Triangle Alphabet Pattern 13

Program 13

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,rows,num,count1;
    cout << "Enter the number of rows" << endl;
    cin>>rows;
    cout << "\nHere your pattern\n" << endl;
    for(i=1; i<=rows; i++){
            num=rows-1;
    count1=i;

        for(j=1; j<=i; j++){
            cout<<((char)(count1+64));
            count1=count1+num;
            num--;
        }
        cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows
6

Here your pattern

A
BG
CHL
DIMP
EJNQS
FKORTU

 

Floyd’s Triangle Alphabet Pattern 14

Program 14

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,k,rows;
    cout << "Enter the number of rows" << endl;
    cin>>rows;
    cout << "\nHere your pattern\n" << endl;
    for(i=rows; i>=1; i--){
            k=i;

        for(j=1; j<=i; j++,k++){
            cout<<((char)(k+64));
        }
        cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows
6

Here your pattern

FGHIJK
EFGHI
DEFG
CDE
BC
A

 

Floyd’s Triangle Alphabet Pattern 15

Program 15

#include <iostream>
#include <conio.h>
using namespace std;

int main()
{
    int i,j,k,rows;
    cout << "Enter the number of rows" << endl;
    cin>>rows;
    cout << "\nHere your pattern\n" << endl;
    for(i=1; i<=rows; i++){
        for(j=i; j<=rows; j++){
            cout<<((char)(j+64));
        }
        cout<<"\n";
    }
    getch();
    return 0;
}

When the above code is executed, it produces the following results

Enter the number of rows
6

Here your pattern

ABCDEF
BCDEF
CDEF
DEF
EF
F

 

Suggested for you

For loop in C++

Nested for loop in C++

Operator in C++

Data type in C++

 

 

Java program to display triangle alphabet pattern
C program to print Floyd's triangle alphabet pattern
Karmehavannan

I am Mr S.Karmehavannan. Founder and CEO of this website. This website specially designed for the programming learners and very especially programming beginners, this website will gradually lead the learners to develop their programming skill.

Recent Posts

C# inverted full pyramid star pattern

C# inverted full pyramid star pattern In this article, we will discuss the concept of…

3 weeks ago

C# Full Pyramid star pattern program

C# Full Pyramid star pattern program In this article, we will discuss the concept of…

1 month ago

Program to count vowels,consonants,words, characters and space in Java

Program to count vowels, consonants, words, characters and space in Java In this article, we…

1 month ago

How to print multiplication table using Array in C++ language

How to print multiplication table using Array in C++ language In this post, we will…

1 month ago

C Program to multiplication table using Array

C Program to multiplication table using Array In this tutorial , we will discuss about…

1 month ago

Java program to check odd or even using recursion

Java program to check odd or even using recursion In this tutorial, we discuss a…

1 month ago