I want to print the following sequence.
__*
_***
*****
_***
__*
Here _ denotes space.
I have written half program to print upto 5 stars and not able to get for down.
#include <stdio.h>
void main()
{
for(int i=1;i<=3;i++)
{
for(int j=1;j<=3-i;j++)
printf(" ");
for(int k=1;k<=(2*i-1);k++)
printf("*");
printf("\n");
}
}
I can print below 5 stars by using two more for loops but I don't want to do it as it will include many loops which is not presentable.