C Program to print Symbol Plus in a star pattern

Program

#include <stdio.h>
void main()
{
    int i, j, num;
    printf("Enter the number of rows:\t");
    scanf("%d", &num);
    for(i = 1; i <= (num * 2 - 1); i++)
    {
        if(i == num)
        {
            for(j = 1; j <= (num * 2 - 1); j++)
            {
                printf("*");
            }
        }
        else
        {
            for(j = 1; j <= (num - 1); j++)
            {
                printf(" ");
            }
            printf("*");
        }
        printf("\n");
    }
}

Output

Enter the number of rows:       5
    *
    *
    *
    *
*********
    *
    *
    *
    *