(c) Figure Q4(c) shows the incomplete C program to calculate the area of trapezoidal using the formula area = (bbot+btop)xht 2. Given bbot is base bottom, btop is base top and ht is height. Binclude // function declaration float trapezoidarea( ); int main () { float bb, bt,h, area; printf ("Enter the base bottom, base top and height of trapezoid: "); Scanf ("f +f ", sbb, sbt, sh) ; //function call area = trapezoidarea (bb, bt,h); fnPrint (area); return 0; // function definition Figure Q4(e) [Rajah Q4(c)] (i) Write a complete program by using function trapezoidArea to calculate the area of trapezoid and function fnPrint to display the calculated circle area. (i) Modify the C program in Figure Q4(c) so that the base bottom, base top and height values enter by user utilizing the function of passing by reference. [Ubah suai atur cara C dalam Rajah Q4(c)

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 6E
icon
Related questions
Question
(C) Figure Q4(c) shows the incomplete C program to calculate the area of trapezoidal
using the formula area = (bbot+btop)xht 2. Given bbot is base bottom, btop is
base top and ht is height.
Finclude<stdio.h>
// function declaration
float trapezoidArea ( );
int main ()
float bb,bt,h, area;
printf("Enter the base bottom, base top and
height of trapezoid: ");
scanf ("f f 2", sbb, abt, &h);
//function call
area = trapezoidArea (bb, bt,h);
fnPrint (area);
return 0;
// function definition
Figure Q4(c)
[Rajah Q4(c)]
) Write a complete program by using function trapezoidArea to calculate the
area of trapezoid and function fnPrint to display the calculated circle area
(ii) Modify the C program in Figure Q4(c) so that the base bottom, base top
and height values enter by user utilizing the function of passing by reference.
[Ubah suai atur cara C dalam Rajah Q4(e)
Transcribed Image Text:(C) Figure Q4(c) shows the incomplete C program to calculate the area of trapezoidal using the formula area = (bbot+btop)xht 2. Given bbot is base bottom, btop is base top and ht is height. Finclude<stdio.h> // function declaration float trapezoidArea ( ); int main () float bb,bt,h, area; printf("Enter the base bottom, base top and height of trapezoid: "); scanf ("f f 2", sbb, abt, &h); //function call area = trapezoidArea (bb, bt,h); fnPrint (area); return 0; // function definition Figure Q4(c) [Rajah Q4(c)] ) Write a complete program by using function trapezoidArea to calculate the area of trapezoid and function fnPrint to display the calculated circle area (ii) Modify the C program in Figure Q4(c) so that the base bottom, base top and height values enter by user utilizing the function of passing by reference. [Ubah suai atur cara C dalam Rajah Q4(e)
Expert Solution
steps

Step by step

Solved in 6 steps with 7 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr