Help me in solving LPYAS164 problem

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

I am unable to see the question so i took your code as it and ran it. You need to add a printf(“*\n”) between the two for loops

Input: 3

Output:
x x x x x x
x x x x
x x
x
x x
x x x x
x x x x x

Lmk if this is what you were expecting or am i missing something…