Thread: inserting a comma on the display

  1. #1
    Registered User
    Join Date
    Oct 2009

    inserting a comma on the display

    I was given a good question and I can't figure it out. It says:

    Write a program that reads in an integer that is greater than 1,000 and less than 1,000,000. The number must be entered without a comma. Display the number with a comma inserted where it belongs. (Hint: use the % operator)

    How can this be solved?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    How do you think it would be solved? Any thoughts on how you'd turn a million into a thousand?

    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Oct 2009
    well, for your question I'd divide by 1000...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. display character size...(quite urgent..)
    By karthi in forum C Programming
    Replies: 10
    Last Post: 07-11-2007, 09:42 PM
  2. new problem with class
    By jrb47 in forum C++ Programming
    Replies: 0
    Last Post: 12-01-2006, 08:39 AM
  3. My text doesn't display
    By joeprogrammer in forum Game Programming
    Replies: 11
    Last Post: 02-23-2006, 10:01 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM