Header Ads

Alphabet Right Angle triangle

Write a program to create the following Pyramid using C program?
         A
  BB
  CCC
  DDDD
  EEEEE
  FFFFFF
  GGGGGGG
  HHHHHHHH
  IIIIIIIIIIIIIIIIIII


**********************Program***********************************

#include<stdio.h>
#include<conio.h>
main()
{
    int r,c,n;
    printf("Enter the numbers of row: ");
    scanf("%d",&n);
    for(r=1;r<=n;r++)
    {
        for(c=r;c>=1;c--)
        {
            printf("%c",64+r);
        }
        printf("\n");
    }
    getch();

}

***********************Output*******************************************

screen shot for  alphabet right angle triangle

No comments