1/ Consider the following C-code that reads the radius of circle and computes its area and circumference. A function with the prototype a void FindAreaCircum(double radius, double *area, double *circum) ; is used to compute the area and the circumference by using pointer concept. #include void area_circum (double radius, double *area, double *circum); int main (void) { double radius, a, c ; printf ("Enter the radius of the circle > ") ; scanf ("%lf", &radius) ; // function call FindAreacircum (radius, &a, &c) ; // displaying the values of area and circumference printf("The area=%f and circumference is &f\n",a,c); return 0; void FindAreaCircum (double radius, double *area, double *circum) *area = 3.14 * radius * radius ; *circum = 2 * 3.14 * radius ; A/ Edit this code and execute it for the input radius: 3.5 B/ Modify this code to compute the area and the volume of the a Box whose dimensions are Length, Width, and Height. Use a separate function FindAreaVol with the prototype void FindAreaVol (double len, double w, double h, double *A, double *Vol); to compute the area and the volume.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

C programming / Finding area

1/ Consider the following C-code that reads the radius of a
circle and computes its area and circumference. A function with
the prototype
void FindAreaCircum(double radius, double *area, double *circum);
is used to compute the area and the circumference by using
pointer concept.
#include <stdio.h>
void area_circum (double radius, double *area, double *circum);
int main (void) {
double radius, a, c ;
printf ("Enter the radius of the circle > ") ;
scanf ("%lf", &radius) ;
// function call
FindAreaCircum (radius, &a, &c) ;
// displaying the values of area and circumference
printf("The area=%f and circumference is %f\n",a,c);
return 0;
void FindAreaCircum (double radius, double *area, double *circum)
*area = 3.14 * radius * radius ;
*circum = 2 * 3.14 * radius ;
A/ Edit this code and execute it for the input radius: 3.5
B/ Modify this code to compute the area and the volume of the a
Box whose dimensions are Length, Width, and Height.
Use a separate function FindAreaVol with the prototype
void FindAreaVol (double len, double w, double h, double *A, double *Vol);
to compute the area and the volume.
Transcribed Image Text:1/ Consider the following C-code that reads the radius of a circle and computes its area and circumference. A function with the prototype void FindAreaCircum(double radius, double *area, double *circum); is used to compute the area and the circumference by using pointer concept. #include <stdio.h> void area_circum (double radius, double *area, double *circum); int main (void) { double radius, a, c ; printf ("Enter the radius of the circle > ") ; scanf ("%lf", &radius) ; // function call FindAreaCircum (radius, &a, &c) ; // displaying the values of area and circumference printf("The area=%f and circumference is %f\n",a,c); return 0; void FindAreaCircum (double radius, double *area, double *circum) *area = 3.14 * radius * radius ; *circum = 2 * 3.14 * radius ; A/ Edit this code and execute it for the input radius: 3.5 B/ Modify this code to compute the area and the volume of the a Box whose dimensions are Length, Width, and Height. Use a separate function FindAreaVol with the prototype void FindAreaVol (double len, double w, double h, double *A, double *Vol); to compute the area and the volume.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY