My issue
iam unable to solve this question
My code
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
for(int i = n; i >= 1; i--)
{
for(int j = 1; j <= i; j++)
{
printf("* ");
}
for(int k = 1; k <= 2*(n-i); k++)
{
printf("");
}
for(int j = 1; j <= i; j++)
{
printf("* ");
}
printf("\n");
}
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= i; j++)
{
printf("* ");
}
for(int k = 1; k <= 2*(n-i); k++)
{
printf("");
}
for(int j = 1; j <= i; j++)
{
printf("* ");
}
printf("\n");
}
return 0;
}
Learning course: Algorithmic Problem Solving
Problem Link: https://www.codechef.com/learn/course/klh-problem-solving/KLHPS2401/problems/LPYAS164