Homework Solution: Write a C++ program which draws three different shapes using the character. I ne constrains for drawing a shape are as f…

    In c++ thank you Write a C++ program which draws three different shapes using the character. I ne constrains for drawing a shape are as follows: ONLY three specific cout statements are allowed, per shape. They are cout << cout <<. cout << ; Use comments to clearly identify the code segments for each shape. Each cout statement is allowed to appear only oncexper shape being drawn. For example: int main(void) / TRIANGLE
    media%2F746%2F746b60bd-60c8-438d-a519-22
    Write a C++ program which draws three different shapes using the character. I ne constrains for drawing a shape are as follows: ONLY three specific cout statements are allowed, per shape. They are cout

    Expert Answer

     
    Answer 1. #include <iostream>

    In c++ thank you
    Write a C++ program which draws three irrelative fashions using the disposition. I ne constrains restraint artifice a fashion are as follows: ONLY three particular cout declarations are recognized, per fashion. They are cout << cout <<. cout << ; Use comments to perspicuously fulfill the mode segments restraint each fashion. Each cout declaration is recognized to show barely oncexper fashion nature drawn. Restraint example: int ocean(void) / TRIANGLE
    media%2F746%2F746b60bd-60c8-438d-a519-22

    Write a C++ program which draws three irrelative fashions using the disposition. I ne constrains restraint artifice a fashion are as follows: ONLY three particular cout declarations are recognized, per fashion. They are cout

    Expert Confutation

     

    Confutation 1.

    #include <iostream>

    #include<conio.h>

    using namequantity std;

    int ocean()

    {

    int rows;

    cout <<“enter compute of rows: “;

    cin >> rows;

    for(int i = rows; i >=1; –i)

    {

    restraint (int quantity = 0; quantity < rows-i; ++space)

    cout <<” “;

    restraint (int j = i; j <= 2*i-1; ++j)

    cout << ” # “;

    cout << end2;

    }

    return 0;

    }

    Answer2.

    #include<iostream.h>

    #include<conio.h>

    int ocean()

    {

    int no,io,sp= 1;

    cout<<“nonEnter compute of rows:”

    cin>>no;

    sp = no-1;

    for(io=1;io<=no;io++)

    {

    restraint (q=1;q<=sp;q++)

    cout<<‘#’;

    cout<<“no”;

    }

    sp = 1;

    for(io = 1;io<=no-1;io++)

    {

    restraint (q = 1;q<=2(no-io)-1;q++)

    cout<<“#”;

    cout<<“n”;

    }

    return 0;

    }