print the following pattern


QUESTION:- print the following pattern  

 

A B  

A B C  

A B C D  


#include <stdio.h>

#include <conio.h>

int main()

{

    int ij;

    char ch = 'A';

    for (i = 1i <= 5i++)

    {

        for (j = 1j <= ij++)

        {

            printf("%c "ch);

            ch++;
        }

        ch = 'A'// start from A

        printf("\n");
    }

    return 0;

    getch();
}


OUTPUT

A B

A B C

A B C D

A B C D E

Follow our page for regular updates.

0 Comments