Question: The function calculate addition takes 2 parameters type of double and returns the result the addition of the 2 arguments. However, the code produces the

 The function calculate addition takes 2 parameters type of double and

The function calculate addition takes 2 parameters type of double and returns the result the addition of the 2 arguments. However, the code produces the wrong output when executed as shown in the figure below. Rewrite the single line of code that will fix this bug mainc 1 #include 2 3 double calculate_addition(double pi, double p2); 4- int main() { 5 6 7 double add; add = calculate_addition (52.1, 23.4); printf("p1 + p2 = %.21f ", add); 10 11 return; 12) 13 14. double calculate_addition(double p1, double p2){ double y; y = pi + p2; return; 18 ) DOWN 15 16 17 19 input main.c:17:5: warning: 'return' with no value, in function returning non-void main.c:14:8: note: declared here pi p2 = 75.50 Program finished with exit code 0 Press ENTER to exit console

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!