Finding Divisers of non-prime numbers!

This is a discussion on Finding Divisers of non-prime numbers! within the C++ Programming forums, part of the General Programming Boards category; Hello everybody; I am new in this forum and c++. I have written a program that finds the divisers of ...

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    6

    Finding Divisers of non-prime numbers!

    Hello everybody; I am new in this forum and c++.
    I have written a program that finds the divisers of non-prime numbers and outputs them. However, the output is only one diviser per line(because of the repetition to find the divbisers), but the instructor wants us to have 5 to 10 divisers per line. How can i write this loop so it will only output the divisers in one line?
    Thank you very much everybody.

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    2,765
    Stop putting out new lines out some of the time.

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with finding only prime numbers with for loops
    By AlmondSeason in forum C++ Programming
    Replies: 11
    Last Post: 02-19-2013, 12:51 AM
  2. Finding prime numbers
    By stdq in forum C Programming
    Replies: 3
    Last Post: 01-28-2012, 12:51 PM
  3. Finding Prime Numbers
    By alireza beygi in forum C Programming
    Replies: 2
    Last Post: 01-13-2012, 04:06 AM
  4. Finding Prime Numbers
    By dan724 in forum C Programming
    Replies: 11
    Last Post: 12-14-2008, 12:12 PM
  5. Finding and Printing prime numbers using arrays
    By Sektor in forum C++ Programming
    Replies: 5
    Last Post: 12-11-2003, 08:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21