C program to print rectangle pattern || Alphabets (Type 2) || Patterns || for loop || C Programming

This is a nested for loop program in which we are going to see how to print the above pattern of Alphabets, with the help of the C Programming language.




#include <stdio.h>

int main()
{
    int i, j;
    char a;
    char b;
    printf("Enter the alphabet from where to start and end \n");
    scanf("%c %c", &a, &b);
    for (i = a; i <= b; i++)
    {
        for (j = a; j <= b; j++)
        {
            // (char)-this keyword convert the ASCII value to the Alphabets.
            printf("%c", (char)j);
        }
        printf("\n");
    }
    return 0;
}


#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post