1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

can anyone write a multiplication program

Discussion in 'C' started by derby20uk, Jan 3, 2007.

  1. derby20uk

    derby20uk New Member

    Joined:
    Jan 3, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Can anyone here write a program in turbo C++

    Its a multiplication and division game needs to be 2-10 times tables

    E.g 9 x 2 =?
    57 / 7 = ?

    The program needs to generate random numbers in the required range 2-10 and also randomly decide whether to offer a multiplication or division problem.

    No answer should ahve a remainder

    The user should be given the opportunity to provide an answer which is checked by the program and if it write it should congratulate the user

    The user should have 6 tryes before thier turn is ended and at the end it should display the user score

    ive be graitful if anyone can do this and post the code
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    This forum is not for getting the assignments / homework done but if you have some queries you can discuss.
     
  3. derby20uk

    derby20uk New Member

    Joined:
    Jan 3, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    this is not for a assignment. ive been playing around with turbo C++. I can write a simple multiplication program. but i cant work out how to write a program to divide without leaving a remainder. could someone write a sample code so show me.
     
  4. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Think about and rephrase your question. Integers which aren't evenly divisible by another integer leave remainders. There's nothing that prevents you from ignoring them, however. Floating point divisions may generate fractional components, some of which do not terminate this side of infinity.

    Deviating from your actual topic, I would suggest that you investigate a more modern compiler, presuming that your system is not ancient. There are many good free alternatives.
     

Share This Page