Sunday, 11 December 2011

Write a program to print a triangle with for loop in c

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

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

No comments:

Post a Comment