Full Diamond Shape.

 

#include <iostream>

#include<string>

using namespace std;

int main()

{

       int a, c, P;

       cout << "Enter Number Of Row's =  ";

       cin >> a;

       for (P = 1; P <= a; P++)

       {

              for (c = 1; c <= a - P; c++)

              {

                     cout << " ";

              }

              for (c = 1; c <= 2 * P - 1; c++)

              {

                     cout << "*";

              }

              cout << endl;

       }

       for (P = 1; P <= a - 1; P++)

       {

              for (c = 1; c <= P; c++)

              {

                     cout << " ";

              }

              for (c = 1; c <= 2 * (a - P) - 1; c++)

              {

                     cout << "*";

              }

       cout << endl;

       }

       system("pause");

}




Comments

Popular Posts