/* Program to print the following output
*
**
***
****
*****
****
***
**
*
*/
#include <stdio.h>
int main()
{
int i, j;
//Prints the upper half part of the pattern
for(i=1; i<=5; i++)
{
for(j=i; j<5; j++)
{
printf(" ");
}
for(j=1; j<=i; j++)
{
printf("*");
}
printf("\n");
}
//Prints the lower half part of the pattern
for(i=5; i>=1; i--)
{
for(j=i; j<=5; j++)
{
printf(" ");
}
for(j=1; j<i; j++)
{
printf("*");
}
printf("\n");
}
return 0;
}