Search:

Type: Posts; User: pbrockway2

Search: Search took 0.12 seconds.

  1. Re: Problem getting code to print string after numbersn that qualkify for it. WHATS W

    Oh! I didn't read the "on the same line" business. Jps is right.

    I interpreted the question's "but" as meaning "instead of" - but either reading's possible.
  2. Re: Problem getting code to print string after numbersn that qualkify for it. WHATS W

    It's hard to say what you're doing wrong without seeing the new code ... ;)

    But, basically, printing the number should be in the last "else" of the if-elseif-chain. That's because you only what...
  3. Re: Problem getting code to print string after numbersn that qualkify for it. WHATS W

    You are printing in the right place. The printing has to be inside the loop because you want to print for each number.

    But see my previous post and make sure you are really clear avout what has...
  4. Re: Problem getting code to print string after numbersn that qualkify for it. WHATS W

    Make sure you are clear about what you have to print. Then think about the code: you may well find that you don't need those string variables at all.

    for loops are the loops of choice when you...
  5. Re: Problem getting code to print string after numbersn that qualkify for it. WHATS W

    Yes, I think you're right. Notice that every line will be HiSomething: that's because every number 2->50 is a multiple of at least one of 2,3,5, or 7. and notice that you only print one thing. ...
  6. Re: Problem getting code to print string after numbersn that qualkify for it. WHATS W

    I'm not sure that the strings are being printed for every number. Check the small numbers. When the problem occurs might give a clue about why.
  7. Re: Problem getting code to print string after numbersn that qualkify for it. WHATS W

    if (i % 5 == 0);
    hiFive = "HiFive";


    Don't put a semicolon as part of the if statement like that.

    Instead:
Results 1 to 7 of 7