Thread: comma

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    1

    comma

    Given a variable between 0 and 2,000,000 how to print out with proper commas
    Eg;if we input 12345 the output should be 12,345

  2. #2
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Location
    Europe
    Posts
    448
    The input should be a string. Then counting the number of spaces form the end instead of the beginning, add the commas in the places.
    Or something like that.
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array (seperate inputs by comma)
    By chuckwag0n in forum C++ Programming
    Replies: 7
    Last Post: 04-03-2009, 01:10 PM
  2. Array (seperate inputs by comma)
    By chuckwag0n in forum C Programming
    Replies: 1
    Last Post: 04-02-2009, 01:01 PM
  3. comma and semi colon
    By studentc in forum C Programming
    Replies: 13
    Last Post: 05-14-2004, 05:49 PM
  4. Comma Operator
    By doraiashok in forum C Programming
    Replies: 2
    Last Post: 12-09-2003, 08:38 AM
  5. Delete last Character (comma) ?
    By Hexxx in forum C Programming
    Replies: 2
    Last Post: 10-19-2003, 12:28 AM