How to Solve a Computer Science C++ Problem?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 2K views
ZincPony
Messages
21
Reaction score
0
Problem Solved thank you
 
Last edited:
Physics news on Phys.org
for (int spaceCtrl = 4; spaceCtrl >=1 ; spaceCtrl--)
This will just print 4 blanks every line. That is you need to change the test condition and associate it with lineCtrl variable.

for (int xCtrl = 1; xCtrl <= lineCtrl; ++xCtrl)
Remember you need 2*lineCtrl-1 X's in each line.
 
doing the 2*lineCtrl-1 send it into an infinite X printing loop.
 
Seems to work fine for me. I am not giving you the code just yet. Why don't you post your revised code? And mind your braces :smile:
 
hey man this is my first C++ class in the summer which means its accelerated. soo he just introduced for loops in wed class soo I am trying to create this from it. I am stumped. can you give me a lil bit of a bigger clue to go from.
 
never mind i figured id it out.

thank you
 

Attachments

  • final.JPG
    final.JPG
    13.4 KB · Views: 441
Last edited: