Computer Science, asked by sivarajpow, 1 month ago

c language pattern program
please anyone answer by clicking the image and see what pattern ia that​

Attachments:

Answers

Answered by anindyaadhikari13
3

\textsf{\large{\underline{Solution}:}}

The given problem is solved using language - C.

#include <stdio.h>

int main() {

   int i,j,n=6;

   for(i=1;i<=n;i++){

       for(j=1;j<=i;j++){

           if(j==1)

               printf("%c ",64+i);

           else if(j==i)

               printf("%d ",i-1);

           else

               printf("* ");

       }

       printf("\n");

   }

   return 0;

}

\textsf{\large{\underline{O{u}tput}:}}

The output for the program is:

A  

B 1  

C * 2  

D * * 3  

E * * * 4  

F * * * * 5  

Note: If you want to take the number of rows as input from the user, then use scanf() function to take 'n' as input.

Attachments:

anindyaadhikari13: If you have any question regarding this co‎de, me‎ss‎‎age me.
Similar questions