[solved]-Wrote Following Code Problem Answer Wrong Negative Fix Q39041398


I wrote the following code for the above problem, but the answeris wrong when it is negative.
How should I fix it?
Determine the integer floor of the sum of two floating point numbers. The floor is the truncated float value, i.e. anythingg after the decimal point is dropped. For instance, floor(1.1 + 3.05) floor(4.15) = 4. Function Description Complete the function addNumbers in the editor below. The function must return an integer that represents the floor of the sum ftwo floating point numbers. addNumbers has the following parameter(s): a: a floating point number b: a floating point number Constraints 0.1 < a, b< 106 a and b have at most 8 places after the decimal #incl ude <assert.h> + Complete the ‘addNumbers’ function bel oW . + The function is expected to return an NTEGER The function accepts fol lowing paramet ers: + 1. FLOAT a + 2. FLOAT b + int addNumbers( float a float b) int result ret urn int) floor (a+b+0,5) Show transcribed image text Determine the integer floor of the sum of two floating point numbers. The floor is the truncated float value, i.e. anythingg after the decimal point is dropped. For instance, floor(1.1 + 3.05) floor(4.15) = 4. Function Description Complete the function addNumbers in the editor below. The function must return an integer that represents the floor of the sum ftwo floating point numbers. addNumbers has the following parameter(s): a: a floating point number b: a floating point number Constraints 0.1
Expert Answer
Answer to I wrote the following code for the above problem, but the answer is wrong when it is negative. How should I fix it?… . . .
OR

