Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can be found by doing a definite integral between the two points.
Solution:
#include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; int numtraps; main( ) { void input(void); float find_area(float a,float b,int n); /* prototype */ print(“AREA UNDER A CURVE”); input( ); total_area = find_area(start_point, end_point, numtraps); printf(“TOTAL AREA = %f”, total_area); } void input(void) { printf(“\n Enter lower limit:”); scanf(“%f”, &start_point); printf(“Enter upper limit:”); scanf(“%f”, &end_point); printf(“Enter number of trapezoids:”); scanf(“%d”, &numtraps); } float find_area(float a, float b, int n) { floatbase, lower, h1, h2; /* LOCAL VARIABLES */ float function_x(float x); /* prototype */ float trap_area(float h1,float h2,floatbase);/*prototype*/ base = (b-1)/n; lower = a; for(lower =a; lower <= b-base; lower = lower + base) { h1 = function_x(lower); h1 = function_x(lower + base); total_area += trap_area(h1, h2, base); } return(total_area); float trap_area(float height_1,float height_2,floatbase) { float area; /* LOCAL VARIABLE */ area = 0.5 * (height_1 + height_2) * base; return(area); } float function_x(float x) { /* F(X) = X * X + 1 */ return(x*x + 1); } Output AREA UNDER A CURVE Enter lower limit: 0 Enter upper limit: 3 Enter number of trapezoids: 30 TOTAL AREA = 12.005000 AREA UNDER A CURVE Enter lower limit: 0 Enter upper limit: 3 Enter number of trapezoids: 100 TOTAL AREA = 12.000438
Disk output : You will already have decided whether to use a hard disk or floppies for storing data. An important point of disk management is to ensure a secure method of kee
Computer: People call a lot of things, computers. Some of them are cheap, but can only process numerical information. Such devices would better be described as 'calculators' r
Advantages:- • Sharing Treads permit the sharing of a lot resources that cannot be shared in process, for instance, sharing code section, data section, Operating System resource
identify application software from the list? ms excel linux internet explorer adobe photshop sound card driver window disk manger adobe dream weaver windows file explorer
Question 1 Draw the block diagram of von Neumann Architecture and explain about its parts in brief Question 2 Draw the block diagram of Intel 8085 CPU organization and explai
Question 1 Define Grid computing Question 2 Explain Attribute-Based Programming Model for Grid Services Question 3 What are the characteristics that users/applicat
Question 1 Describe the following with respect to creating Web Forms in .Net environment- Web Form Life Cycle Creating a Web Form Write programs with corresponding
Question 1 Briefly explain principles of effective navigation Question 2 Explain the terms URI and URL. Why should you use Relative URI? Question 3 What are the di
What is CAI? Explain its pitfalls.
Desktop computer: Desktop computer is popularly known as personal computer (PC). As the name suggest, it is generally small in size and fitted on the top of a desk which can b
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd