/* Program to print the following output
*****
* *
* *
**
*
*/
#include <stdio.h>
int main()
{
int i, j;
//Outer loop for iterating over rows
for(i=1; i<=5; i++)
{
for(j=i; j<=5; j++)
{
/*
* Stars gets printed only for row=1, column=1 or column=5
*/
if(i==1 || j==i || j==5)
{
printf("*");
}
else
{
//Print spaces if stars don't get printed
printf(" ");
}
}
printf("\n");
}
return 0;
}