Header Ads

Continue Alphabet Right Angle Triangle

Write a program to create the following Pyramid using C program?
         A
  B C
  D E F
  G H I J
  K L M N O


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

#include<stdio.h>
#include<conio.h>
main()
{
    int r,c,i=0;
    for(r=1;r<=5;r++)
    {
        for(c=r;c>=1;c--)
        {
            printf("%c ",65+i);
            i++;
        }
        printf("\n");
    }
    getch();

}


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



screen shot for alphabet right angle triangle

No comments