Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Print Remainder

  1. May 23, 2004 #1
    Hello.

    I would like to write a program into which I can input any number, say 11133, and divide this by a list of numbers, say 543, 345, 2368...
    and have the program print the list of results, integers only, with the remainder.

    I imagine this is a fairly simple program to write, but I am still unfamiliar as yet with what steps to take to begin. Would anyone be able to help. Thanks in advance.

    Dan
     
  2. jcsd
  3. May 23, 2004 #2

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    First, select a language.

    - Warren
     
  4. May 25, 2004 #3
    Hi Warren,

    Thanks,
    I have started using a '94 version of C++,
    are you familiar with this?
    I managed to get a useful program working.

    Two problems though that I have not been able to find solutions to yet.

    1) How do i get it so the program resets at the press of a button so I don't have to keep exiting and entering again?

    2) Even though I am using "long" integers throughout, the program will not print values better than about 250 000. beyond this I just get garbled data.

    Thanks,
    Dan
     
  5. Jun 8, 2004 #4
    carterw,

    If C++ is your language of choice and you don't have a manual explaining the coding requirements, then I would recomend that you do that first. You don't have to read the book from cover to cover, but, understand the overall methodology of the language and focus on the sections that address the specific functions you need. Anytime spent learning a language such as an all purpose tool like C++, is time well spent.

    You are right. Once you review the manual, this job should take only a few minutes to complete.
     
    Last edited: Jun 8, 2004
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Print Remainder
  1. PDF and printing (Replies: 13)

  2. Printing a string (Replies: 4)

  3. Pretty Print (Replies: 2)

  4. Printing Documents (Replies: 2)

Loading...