Answer to Question #284718 in C++ for papi

Question #284718

Write a C program that would generate the pattern below:

*

**

***

*****

******

*****

****

***

**

*


1
Expert's answer
2022-01-12T09:56:57-0500
#include <iostream>



int main(int argc, char* argv[])
{
    char c = '*';
    std::cout << c << std::endl;
    std::cout << c << c << std::endl;
    std::cout << c << c << c << std::endl;
    std::cout << c << c << c << c << c << std::endl;
    std::cout << c << c << c << c << c << c << std::endl;
    std::cout << c << c << c << c << c << std::endl;
    std::cout << c << c << c << std::endl;
    std::cout << c << c << std::endl;
    std::cout << c << std::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
New on Blog