#include <stdio.h>
#include <conio.h>
int main()
{
int i, j, k, r;
printf("Enter number of rows: ");
scanf("%d", &r);
for(i=1; i<=r; i+=2)
{
for(j=r-2; j>=i; j-=2)
{
printf(" ");
}
for(k=1; k<=i; k++)
{
printf("*");
}
printf("\n");
}
for(i=r-2; i>=1; i-=2)
{
for(j=r-1; j>=i; j-=2)
{
printf(" ");
}
for(k=1; k<=i-1; k++)
{
printf("*");
}
printf("\n");
}
getch();
}