Thread: Help with simple while program!!!!

  1. #46
    Registered User
    Join Date
    Feb 2009
    Posts
    83
    Quote Originally Posted by laserlight View Post
    Yes
    Ok then where would I use it as?

  2. #47
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,401
    Well, think of the logic: you count from 1. Every time this counter is divisible by 6, you print a new line.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #48
    Registered User
    Join Date
    Feb 2009
    Posts
    83
    Quote Originally Posted by laserlight View Post
    Well, think of the logic: you count from 1. Every time this counter is divisible by 6, you print a new line.
    Well yea but isn't it 12. I get that but I don't know where I would need a "counter2"
    Last edited by walkonwater; 03-28-2009 at 01:58 PM.

  4. #49
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    When I first touched a computer (a VIC20) all those years ago, I'm sure I would have worked it out quicker than this. As far as programming problems go, this one is very very simple. walkonwater, I believe that you're not getting there because you're not learning to think for yourself. You're too reliant on help that's only a few clicks away.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with a very simple program
    By htdefiant in forum C++ Programming
    Replies: 13
    Last Post: 08-14-2007, 01:27 PM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. [Help] Simple Array/Pointer Program
    By sandwater in forum C Programming
    Replies: 3
    Last Post: 03-30-2007, 02:42 PM
  4. simple silly program
    By verbity in forum C Programming
    Replies: 5
    Last Post: 12-19-2006, 06:06 PM
  5. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM