0

I am writing a calculator program in C. I need a function definition for a function called Subtract() that will allow me to calculate the difference of several numbers entered by the user also need one for division

4
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by John A
0

That's not so hard.. Have you tried anything yet? Have you learned about functions? Example:

int Substract(int x, int y)
{
    //do something with x and y
    return answer;
}

Niek

0

Not that easy, I guess you need to parse a complex expression like a+b-c*d and evaluate, you need to learn about binary search tree, and about postorder traversal ,etc.

0

Not that easy, I guess you need to parse a complex expression like a+b-c*d and evaluate, you need to learn about binary search tree, and about postorder traversal ,etc.

Hey thanks I figured it wouldnt be easy.

0

Not that easy, I guess you need to parse a complex expression like a+b-c*d and evaluate, you need to learn about binary search tree, and about postorder traversal ,etc.

Not necessarily. If it's just a simple calculator program (as the original poster seems to be implying), then the program itself will likely be no more complex than a simple pocket calculator. Remember, a program only has to be as complex as the requirements state.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.