Diamond shape programming code with the help of c++
Making diamond 💎 s

Program for diamond shape 💎

Diamond shape programming code with the help of c++
Making diamond 💎 shape

 

#include <iostream>

using namespace std;

class A {

public:

    void show() {

        cout << “Diamond pattern: “;

        for(int sp = 0; sp < 4; sp++) {

            cout << “\n”;

        }

        int a = 7;

        for(int i = 4; i > 0; i–) {

            for(int j = 0; j < i; j++) {

                       cout << ” “;

            }

            for(int l = 0; l < a; l++) {

                if (l == 0|| i== 4 || l==a-1) {

                    cout << “🔴”;

                }

                else {

                    cout << “💎”;

                }

            }

            cout << endl;

            a += 2;

        }

        int e = 0;

        for(int b = 2; b < 8; b++) {

            for (int c = 0; c < b; c++) {

                cout << ” “;

            }

            for(int d = 11; d > e; d–) {

                if(d == 11 || d == e + 1) {

                    cout << “🔴”;

                }

                else{

                    cout << “💎”;

                }

            }

            e += 2;

            cout << endl;

        }

        cout << “\n\n\nCreated by Akash\nThanks for watching!🙂”;

    }

};

int main() {

    A obj;

    obj.show();

    return 0;

}

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A

👉🏻 Instagram : https://www.instagram.com/thetechdcode/

👉🏻 Facebook Page : https://www.facebook.com/thetechdcode

👉🏻 Twitter : https://twitter.com/thetechdcode

👉🏻 Telegram Channel : https://t.me/thetechdcode

👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode

👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :

👉🏻 Instagram : https://www.instagram.com/virtualshivamin/

👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/

👉🏻 Twitter : https://twitter.com/virtualshivamin/

👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin

Leave a Reply

Your email address will not be published. Required fields are marked *