Header Ads

C Pyramid_2

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

}

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

screenshot for above pyramid

No comments