Program to print following pattern:-
*
**
***
****
*****
#include <stdio.h>
#include <conio.h>
void main()
{
int i, j, rows=7;
printf("The pattern is below: \n");
for(i=1; i<=rows; i++)
{
for(j=i; j<rows; j++)
{
printf(" ");
}
for(j=1; j<=i; j++)
{
printf("*");
}
printf("\n");
}
getch();
}
*
**
***
****
*****
#include <stdio.h>
#include <conio.h>
void main()
{
int i, j, rows=7;
printf("The pattern is below: \n");
for(i=1; i<=rows; i++)
{
for(j=i; j<rows; j++)
{
printf(" ");
}
for(j=1; j<=i; j++)
{
printf("*");
}
printf("\n");
}
getch();
}