Thats the code i have so far:
int _tmain(int argc, _TCHAR* argv[])
{
for ( int i = 1; i <= 9; i++)
{
for ( int j = 1; j <= 15; j++) { cout << "*"; }
cout << endl;
}
return 0;
}
but can't figure out how to make this one :
Write a program to display the following pattern
x x x x x
x x x x x
x x x x x
x x x x x x x x x x x x x x x
x x x x x x x x x x x x x x x
x x x x x x x x x x x x x x x
x x x x x
x x x x x
x x x x x
PulsarScript
0
Junior Poster
Recommended Answers
Jump to PostYou need your loop to contain two different sets of behaviour. One for when i is 1-3 and 7-9, and one for when it is 4-6.
Jump to PostYou can't do all that in one loop. In the first loop, print 5 spaces then 5 stars. Then in a second loop print 15 stars. The third loop is the same as the first loop. This is assuming you are required to use loops to print the characters one …
All 6 Replies
Moschops
683
Practically a Master Poster
Featured Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
Jamblaster
15
Newbie Poster
darkfire3133
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.