Write a C program with 4 functions in main
1 int intSum(intx, int y)
accept 2 ints as parameters
adds the 2 # up
returns the sum
2. int intdiff(intx, inty)
accepts 2 # as param.
subtracts them
returns with diff.
3 int intProd(intx, int y)
accepts 2 #
muiltplies them
returns product
4 double Quot(int x, int Y)
accepts 2 #
divides them
returns quot/ with remainer as decimel.
should spit out
the sum of the 2 mnumbers is
the difference of 2 numbers is
the product of 2 numbers is
the quotient of 2 numbers is

Recommended Answers

All 4 Replies

I don't see a question, nor code. Please read the post at the top of the forum about homework...

Code is saved as an attached file to the post. See it?

int main()
[

Typo, it should be a {

z = intSum(x,y)

You didn't declare x nor y, I think you want to send numX and numY. ( intSum(numX, numY); )
Same with the other 3 functions.

You need to declare the functions before you use them.

put this:
int intSum( int , int );
int intDiff(int , int );
int inProd(int , int );
double Quot(int , int );

Above main().

And there are a lot of typ-errors in your code. Please note that C is CASE-sensitive. Also look for missing semi-colons ( ; ). If you call your function Quot(), don't call it with inQuot or intQuot.

return 0;
}

This should be in Main(). This doesn't do anything right now. I have a working code for you, but first try to correct it your self.

regards Niek

Code is saved as an attached file to the post. See it?

Yeah, but I don't open attachments.... I practice safe computing ;)
But there still wasn't a question, nor an explanation of what was wrong.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.