C++ Program to Print Cross Star Pattern

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



Source Code
#include <iostream>
using namespace std;

int main()
{
    int i,j;
    for (i=0; i<5; i++)
    {
        for (j=0; j<5; j++)
        {
            if (i==4-j || i==j)
            {
                cout<< "* ";
                continue;
            }
            cout<< "  ";
        }
        cout<< "\n";
    }
    return 0;
}
Output
*       *
  *   *
    *
  *   *
*       *