Saturday, June 18, 2016

C Program Code: Equilateral Triangle

C Program Code:


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

    printf("Equilateral Triangle in C \n");
    printf("Enter Size : ");
    scanf("%d",&size);

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

Equilateral Triangle in C Output Screenshot