noob help with very simple calculation

This is a discussion on noob help with very simple calculation within the C Programming forums, part of the General Programming Boards category; nevermind solved it! , sorry!...

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    1

    noob help with very simple calculation

    nevermind solved it! , sorry!
    Last edited by blastfromthepas; 10-31-2009 at 05:20 AM. Reason: solved

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Change "result" to cars, then use this to figure tires left:

    Tires Left = Starting tires - (4 * number of cars)

    or

    Tires Left = starting tires % (4 * number of cars)

    And you should use int's as your data type, instead of floats - unless you're going to start installing just fractions of tires, or put them on fractions of cars.
    Last edited by Adak; 10-31-2009 at 05:08 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple pointer question but i'm a noob
    By tesla in forum C++ Programming
    Replies: 2
    Last Post: 09-20-2009, 03:12 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  3. simple noob question
    By NiVaG in forum Linux Programming
    Replies: 5
    Last Post: 09-28-2004, 07:56 PM
  4. Simple calculation not working, need help
    By Summonerur in forum C Programming
    Replies: 20
    Last Post: 09-24-2004, 03:53 PM
  5. Need help with simple DAQ program
    By canada-paul in forum C++ Programming
    Replies: 12
    Last Post: 03-15-2002, 08:52 AM

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