Pages

Sunday, 20 May 2012

program to print a triangle


71./*Write a program to print a triangle.*/

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=0;i<=10;i++)
{
for(j=0;j<i;j++)
{
printf("*");
}
printf("\n");
}
getch();
}

OUTPUT
            *
            **
            ***
            ****
            *****

No comments:

Post a Comment