Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions