Thread: C - Help with making a simple calculator.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Actually tabstop, your last suggestion there would seem to match the criteria of the program. Based on the "menu" string in the original post, the "modulus" option is expecting integers - so there shouldn't be any fractional parts if proper input specs are heeded. Casting the inputs to int would be an alternative, as well.

  2. #2
    Registered User
    Join Date
    Jan 2014
    Location
    Kentucky
    Posts
    14
    Quote Originally Posted by Matticus View Post
    Actually tabstop, your last suggestion there would seem to match the criteria of the program. Based on the "menu" string in the original post, the "modulus" option is expecting integers - so there shouldn't be any fractional parts if proper input specs are heeded. Casting the inputs to int would be an alternative, as well.
    Oh my.. you are right.. Can't believe I didn't realize this. Thank you!


    Quick Question... pretty much anything I input into the modulus function, it returns a 0. Is that normal?

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by Nurein Ahmed View Post


    Quick Question... pretty much anything I input into the modulus function, it returns a 0. Is that normal?
    Only if the first number is a multiple of the second.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Making calculator in C
    By HolyTurtle in forum C Programming
    Replies: 17
    Last Post: 12-30-2010, 08:05 PM
  2. Making a simple calculator
    By ChvyVele in forum C++ Programming
    Replies: 12
    Last Post: 05-12-2008, 05:05 PM
  3. Making a calculator (newbie)
    By Swerve in forum C++ Programming
    Replies: 4
    Last Post: 09-06-2007, 07:57 PM
  4. Making a calculator run again!
    By cookie in forum C Programming
    Replies: 15
    Last Post: 06-10-2007, 09:56 AM
  5. Replies: 2
    Last Post: 01-13-2003, 01:28 PM

Tags for this Thread