print the following pattern



QUESTION:- print the following pattern  

A 

B C  

D E F  

G H I J  

K L M N O  


#include <stdio.h>

#include <conio.h>

int main()

{

    int ijalp;

    printf("enter a value: ");

    scanf("%d", &alp);

    char ch = 65// here we can make a change with (ASCII value and alphabet).

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

    {

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

        {

            printf("%c "ch);

            ch++;
        }

        printf("\n");
    }

    return 0;

    getch();
}


OUTPUT

enter a value: 5

A 

B C  

D E F  

G H I J  

K L M N O  


Follow our page for regular updates.

0 Comments