Answer to Question #157831 in C++ for Swet

Question #157831
program that draws a figure resembling the letter 'Z' with sides (50, 100, 50) and the angle between them to be 60 degrees
1
Expert's answer
2021-01-23T15:46:18-0500
#include <iostream>
using namespace std;
int main () {
    for (int i = 0; i < 50; i++) {
        if (i  == 0 || i == 49) {
            for (int j = 0; j < 50; j++) {
                cout << "*";
            }
            cout << endl;
        }
        else {
            for (int j = 0; j < 50; j++) {
                if (i + j == 50) {
                    cout << "*";
                }
                else {
                    cout << " ";
                }
            }
            cout << endl;
        }
    }
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS