Alphabet Letter Pattern Series Programs in C

Alphabet Letter Pattern Series Programs in C

1 Write a program to generate/print following pattern/series:

AAAAA
AAAAA
AAAAA
AAAAA
AAAAA
#include<stdio.h>
int main()
{
    int i,j;
    for(i=1;i<=5;i++)
    {
        for(j=1;j<=5;j++)
        {
            printf("A");
        }
        printf("\n");
    }
    return 0;
 }

2 Write a program to generate/print following pattern/series:

A
AA
AAA
AAAA
AAAAA
#include<stdio.h>
int main()
{
    int i,j;
    for(i=1;i<=5;i++)
    {
        for(j=1;j<=i;j++)
        {
            printf("A");
        }
        printf("\n");
    }
    return 0;
 }

3 Write a program to generate/print following pattern/series:

A
BB
CCC
DDDD
EEEEE
#include<stdio.h>
int main()
{
    int i,j;
    for(i='A';i<='E';i++)
    {
        for(j='A';j<=i;j++)
        {
            printf("%c",i);
        }
        printf("\n");
    }
    return 0;
 }

4 Write a program to generate/print following pattern/series:

A
AB
ABC
ABCD
ABCDE
#include<stdio.h>
int main()
{
    int i,j;
    for(i='A';i<='E';i++)
    {
        for(j='A';j<=i;j++)
        {
            printf("%c",j);
        }
        printf("\n");
    }
    return 0;
 }

5 Write a program to generate/print following pattern/series:

A
BC
DEF
GHIJ
KLMNO
#include<stdio.h>
int main()
{
    int i,j,k='A';
    for(i='A';i<='E';i++)
    {
        for(j='A';j<=i;j++)
        {
            printf("%c\t",k);
            k++;
        }
        printf("\n");
    }
    return 0;
 }

Published by

admin

I am a computer teacher, programmer and web developer