Write a program to print the triangle of stars.

#include<stdio.h>

#include<conio.h>

int main()

{

clrscr();

int i,j;
printf(“Welcome to www.candcpp.com\n”);

for(i=1;i<=5;i++)

{

for(j=1;j<=i;j++)

{

printf(“*”);

}

printf(“\n”);

}

getch();

return 0;

}

 

The output will be:

Welcome to www.candcpp.com

*
**
***
****
*****