Saturday, June 18, 2016

C Program Code: Draw A Right Angled Triangle

C Program Code:

#include<stdio.h>
#include<conio.h>
int main()
{
    int size;
    int i,j,space;

    printf("Draw A Right Angled Triangle in C \n");
    printf("Enter Size : ");
    scanf("%d",&size);

    for(i=1; i<=size; i++)
    {
        for(space=1; space<=size-i; space++)
        {
            printf(" ");
        }
        for(j=1; j<=i; j++)
        {
            printf("*");
        }
        printf("\n");
    }
getch();
return 0;
}

Draw A Right Angled Triangle in C Output Screenshot