Skip to content
Programmingoneonone
Programmingoneonone
  • Engineering Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
    • 100+ C++ Programs
  • Solutions
    • HackerRank
      • Algorithms Solutions
      • C solutions
      • C++ solutions
      • Java solutions
      • Python solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

C++ program to display pattern of alphabets

YASH PAL, 31 July 202419 February 2026

In this post, we will write a C++ program to display patterns of alphabets. the first user will enter the number between 1-19 and then the program will print the pattern of that equivalent character on the output screen.

C++ program to display pattern of alphabets

C++ program to display patterns of alphabets.

#include<iostream>
#include<conio.h>
#include<windows.h>


BOOL gotoxy(const WORD x, const WORD y) {
    COORD xy;
    xy.X = x;
    xy.Y = y;
    return SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), xy);
}

int main()
{
    system("cls");
    int i,j,n;
    char ch;

    std::cout<<"Enter the number (1-19) you want the alphabets display = ";
    std::cin>>n;

    for(i=65;i<=65+n;i++)
    {
        for(j=1;j<=65+n-i;j++)
        {
                ch = i;
                gotoxy(i-64+i-64,j+5);
                std::cout<<ch<<std::endl;
        }
    }

    for(i=65+n;i>=65;i--)
        for(j=i;j<=65+n-1;j++)
        {
            ch = i;
            gotoxy(65+n-i+65+n-i+(n+n-2), 72-j+(n-2));
            std::cout<<ch<<std::endl;
        }

        getch();
        return 0;
}

Output

Enter the number(1-19) you want the alphabet display = 19

A B C D E F G H I J K L M N O P Q R S R Q P O N M L K J I H G F E D C B A
A B C D E F G H I J K L M N O P Q R   R Q P O N M L K J I H G F E D C B A
A B C D E F G H I J K L M N O P Q       Q P O N M L K J I H G F E D C B A
A B C D E F G H I J K L M N O P           P O N M L K J I H G F E D C B A
A B C D E F G H I J K L M N O               O N M L K J I H G F E D C B A
A B C D E F G H I J K L M N                   N M L K J I H G F E D C B A
A B C D E F G H I J K L M                       M L K J I H G F E D C B A
A B C D E F G H I J K L                           L K J I H G F E D C B A
A B C D E F G H I J K                               K J I H G F E D C B A
A B C D E F G H I J                                   J I H G F E D C B A
A B C D E F G H I                                       I H G F E D C B A
A B C D E F G H                                           H G F E D C B A
A B C D E F G                                               G F E D C B A
A B C D E F                                                   F E D C B A
A B C D E                                                       E D C B A
A B C D                                                           D C B A
A B C                                                               C B A
A B                                                                   B A
A                                                                       A
C++ Programming Tutorials coding problems solutions C++ ProgramsPrograms

Post navigation

Previous post
Next post

Leave a Reply

Your email address will not be published. Required fields are marked *

C++ Program to print a message on the screen
Project - Library Management System Program in C++
C++ Program to calculate the salary of the servant
C++ Program to find out the grades of given marks
C++ Program to find out the greater number from given numbers
C++ Program to find out whether the given number is odd or even
C++ Program to inherit derived constructor
C++ Program to display the reverse of a given number
C++ Program to print the ASCII value of a character
C++ Program to convert temperature from Fahrenheit to centigrade
C++ Program to enter two numbers and show their sum
C++ Program to swap two numbers using third variable
C++ Program to calculate the result of students using marks
C++ game to find out a number
C++ Program to print the table of a number
C++ Program to find out the smallest number from given numbers
C++ Program to calculate the factorial of a given number
C++ Program to select an operation from a list and display its results
C++ Program to generate a random number in circles and find out the sum
C++ Program to solve arithmetic operations
C++ Program to convert the dollar into different currencies
C++ Program to display the given number in roman number
C++ Program to find out whether the given character is a vowel or not
C++ Program to use symbols as words using preprocessor Directives
C++ Program to calculate the age of a human by entering the date of birth
C++ Program to convert the upper to lower and lower to upper case letters
C++ Program to calculate the electricity bill of consumed units by the user
C++ Program to convert the small case letters to upper case letters
C++ Program to find out the nth term of its factorial
C++ Program to search for a number from a list by sequential search
C++ Program to find out the exponent of a given number
C++ Program to sort characters in ascending order by using bubble sort
C++ Program to display the text in different colours
C++ Program to convert the decimal number into a binary number
C++ Program to find out the day of the given date, starting from Jan 2001
C++ Program to find out the maximum number from an array
C++ program to display the ASCII values
C++ Program to calculate the area of a room
C++ Program to print students' details using a structure
C++ Program to display a stopwatch on screen for 2 minutes
C++ Program to print a diamond pattern of stars
C++ Program to display the pattern of alphabets
C++ Program to find out the factors of a given number
C++ Program to display the sum of mathematics series
C++ Program to create a game [Find Hidden Word]
C++ Program to display the rectangle on the screen
C++ Program to sort the numbers using selection sort
C++ Program find out whether the given number is prime or not
C++ Program to sort the numbers using insertion sort
C++ Program to display a word in the middle of the screen
C++ Program to create a puzzle game
C++ Program to find out Armstrong numbers from 1 to 500
C++ Program to compare two strings
C++ Program to calculate the number of characters in the given string
C++ Program to calculate the standard deviation of a given range
C++ Program to open a file in binary mode and then get data in that file
C++ Program to use the setw function
C++ Program to create a file in binary mode and then put data in that file
C++ Program to display the Fibonacci series using a function
C++ Program to count the characters, tabs, and vowels in a line from a file
C++ Program to find out the raise to a power using recursion
C++ Program to copy data from one file to another file
C++ Program to find out the prime numbers from a given range
C++ Program to count the number of lines in a file
C++ Program to calculate the square root of a given number
C++ Program to copy a string into a file, then read it and display it on the screen
C++ Program to print the values of a pointer character array
C++ Program to create a file in text mode, write and then read data from the file
C++ Program to access the value of a variable using a pointer
C++ Program to use a friend class
C++ Program to display the address of a variable
C++ Program to display the distance in feet and inches
C++ Program for Matrix Multiplication
C++ Program to use a destructor
C++ Program to create user define header file
C++ Program to calculate the multiplication of two numbers without using the * symbol
C++ Program to find out the smallest number from the given numbers
C++ Program to search a record from a file
C++ Program to search a record from a binary file
C++ Program to open a file in binary mode and count the total records
C++ Program to inherit the class
C++ Program to overload binary operators
C++ Program to overload [] binary operator
C++ Program for binary operator overloading
C++ Program to display the file using the command line of the compiler
C++ Program to update the record in binary mode
C++ Program to search the record in binary file
C++ Program to display a message by using multiple virtual functions
C++ Program to display a message by using a virtual function
C++ Program to multiply three numbers using a friend function
C++ Program to override a function

Programmingoneonone

We at Programmingoneonone, also known as Programming101 is a learning hub of programming and other related stuff. We provide free learning tutorials/articles related to programming and other technical stuff to people who are eager to learn about it.

Pages

  • About US
  • Contact US
  • Privacy Policy

Practice

  • Java
  • C++
  • C

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2026 Programmingoneonone | WordPress Theme by SuperbThemes