Answer to Question #49477 in C++ for AJ Cabredo

Question #49477
Help Please..!! C++ program that print a pattern.. ********** -********- --******-- ---****--- ----**--- Only three to four for loops or it is okay if there is an if else statement..
Expert's answer
#include <iostream>
using namespace std;
int main()
{
for(int i = 0; i < 5; i++)
{
for(int j = 0; j < i; j++)
cout << "_";
for(int j = 0; j < 2*(5 - i); j++)
cout << "*";
for(int j = 0; j < i; j++)
cout << "_";
cout << endl;
}
cin.get();
cin.get();
}


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 first!

Leave a comment

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal