display of divisors

This is a discussion on display of divisors within the C++ Programming forums, part of the General Programming Boards category; hey all i gotta write a programs that works like this: --------------------------- Enter number: 12 Divisors: 1 2 3 4 ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    28

    display of divisors

    hey all i gotta write a programs that works like this:
    ---------------------------
    Enter number: 12
    Divisors: 1 2 3 4 6
    ---12 is Abundant
    ---------------------------

    Can anybody tell me how to display the divisors in one line like that? i know how to do the rest btw; thanx

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,448
    Well, if you know how to do the rest, what have you done?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    28
    i know how to write the code but it only displays the first divisors which is 1, now i want it to display them all

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,448
    i know how to write the code but it only displays the first divisors which is 1, now i want it to display them all
    Clearly, you need to use at least one loop.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Display Color dialog
    By Cherry65 in forum Windows Programming
    Replies: 4
    Last Post: 02-17-2009, 10:41 AM
  2. display character size...(quite urgent..)
    By karthi in forum C Programming
    Replies: 10
    Last Post: 07-11-2007, 09:42 PM
  3. new problem with class
    By jrb47 in forum C++ Programming
    Replies: 0
    Last Post: 12-01-2006, 07:39 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Speeding Up Display Time in CEditView :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 04-22-2002, 07:24 PM

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