Header Ads

Opposite Right Angle Triangle

Write a program to create the following Pyramid using C program?
       @@@@@@
@@@@@
@@@@
@@@
@@
@

************************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=(n-r);c>=1;c--)
        {
            printf("@");
        }
        printf("\n");
    }
    getch();

}

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

screen shot for above pyramid


No comments