0
1.8kviews
Write a program the display following pattern

enter image description here

Mumbai university > FE > SEM 2 > Structured Programming Approach

Marks: 10M

Year: May 2015

1 Answer
0
1views

enter image description here

#include<stdio.h>
void main()
{
int i,j,rows;
char temp;
    printf("Enter uppercase character you want in triangle at last row: ");
    scanf("%c",&input);
for(i=rows;i>0;i--)
{
    temp = ‘A’;     
    for(j=1;j<=i;++j)
    {
           printf("%c",temp);
++temp;
    }
        printf("\n");
}
getche();
}

enter image description here

#include<stdio.h>
void main()
{
int i,j,rows;
char temp;
    printf("Enter uppercase character you want in triangle at last row: ");
    scanf("%c",&input);
for(i=1;i<=rows;i++)
{
      for (j=1;j<=i;j++)
       {
         printf(“%d “,j);
       }
      temp = ‘A’;     
    for(j=1;j<=i;++j)
    {
           printf("%c",temp);
++temp;
    }
    printf("\n");
}
getche();
}
Please log in to add an answer.