c++ calculator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wh001
    New Member
    • Oct 2008
    • 2

    c++ calculator

    how to write a c++ program that mimics a calculator, the program should take as input two integers and the operation to be performed. It should then ouput the numbers, the operator, and the result. It has to handle addition, subtraction, multiplication and division.
  • wh001
    New Member
    • Oct 2008
    • 2

    #2
    Need With C++ Really Bad. Help!

    My question is how to write a c++ program that mimics a calculator, the program should take as input two integers and the operation to be performed. It should then ouput the numbers, the operator, and the result. It has to handle addition, subtraction, multiplication and division. I would appreciate it very very very much. THANKS!

    Comment

    • 200dogz
      New Member
      • Oct 2008
      • 52

      #3
      Depends what kind of input there will be...

      Do you want the calculator to accept a string of numbers and operations:

      eg. "3 + 5 * 6"

      or are you trying to make a program with GUI, and a button for each operation etc?

      Comment

      • gpraghuram
        Recognized Expert Top Contributor
        • Mar 2007
        • 1275

        #4
        Please read Posting guidelines before posting.
        If you need to know how to write this, then in K&R C book there is a C code.
        Start from there and you can easily write a C++ one from it.

        Raghu

        Comment

        • gpraghuram
          Recognized Expert Top Contributor
          • Mar 2007
          • 1275

          #5
          Please dont double post and people here wont write the code for you.

          Raghu

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #6
            Please do not double post, I have now merged the 2 threads you started.

            The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

            Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

            Then when you are ready post a new question in this thread.

            Banfa
            Administrator

            Comment

            Working...