C Program to Print Cross Star Pattern

In this program, you'll learn to print cross star pattern.



Source Code
#include <stdio.h>
int main()
{
    int i,j;
    for (i=0; i<5; i++)
    {
        for (j=0; j<5; j++)
        {
            if (i==4-j || i==j)
            {
                printf("* ");
                continue;
            }
            printf ("  ");
        }
        printf("\n");
    }
    return 0;
}
Output
*       *
  *   *
    *
  *   *
*       *