Saturday, June 18, 2016

C Program Code: Print Reverse Triangle

C Program Code:

#include<stdio.h>
#include<conio.h>
int main()
{
    int size,space;
    int i,j;
    printf("Print Reverse Triangle in C \n");
    printf("Enter Size : ");
    scanf("%d",&size);
    for(i=size; i>=1; i--)
    {
        for(space=1; space<=size-i; space++)
        {
            printf(" ");
        }
        for(j=1; j<=i; j++)
        {
            printf("*");
        }
        printf("\n");
    }
getch();
return 0;
}

Print Reverse Triangle in C Output Screenshot