Can you give an idea how to create this pattern:7. 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
I know it should be simple enough
I just starting c++ and would like to see the process.My guess is: need to use
for loop and if statement,but how to combine it together?Regards
PulsarScript
0
Junior Poster
Recommended Answers
Jump to PostStart by printing a block of x's:
for (int i = 0; i < 9; i++) { for (int j = 0; j < 15; j++) { cout.put('x'); } cout.put('\n'); }
From there you can play around with ideas on how to identify the corner blocks …
All 2 Replies
Reply to this topic
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.