Answer to Question #273723 in C++ for DANISH

Question #273723

Write a program that can able to print the following pattern:


*

***

*****

*******

*********





1
Expert's answer
2021-11-30T18:18:03-0500
#include <iostream>

int main()
{
    for(int i = 1; i <= 9; i+=2)
    {
        std::cout << std::string(i, '*') << "\n";
    }
    
    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
APPROVED BY CLIENTS