C Program to implement Integration.

C Program to implement Integration. Integration is the important concept of calculus, which is the inverse of the differentiation. A definite integral gives the area between the graph of a function and the horizontal axis between vertical lines at the endpoints of an interval. Integration is used to find the area, volume of irregular shapes. In the following code, We find the integration of the defined function between two boundary limits, which are entered by the user. Read more about C Programming Language .

* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* and browse!
* Happy Coding

#include <stdio.h>
/* Propram to perform definite integration of a given function between
two boundary limits input by user. Feel free to use and modify it, but
please do not remove this comment.
source: C for Engineering, http://c4engineering.hypermart.net */

#define N 1000

void main(void) {
float i, a, b, sum = 0;
"nThis program will integrate a function between two boundary limits.");
printf("nnEnter the first boundary limit:");
scanf("%f", &a);
printf("nEnter the second boundary limit:");
scanf("%f", &b);
if (a > b) {
i = a;
a = b;
b = i;

for (i = a; i < b; i += (b - a) / N) {
/* Define your function below, and include the suitable header files */
y = x * x + 2 * x - 4;
sum += y * (b - a) / N;

printf("nnValue of integration is:%.3f", sum);

Array In C

C Data Structures

Simple C Programs




our page!

Share this program with your Facebook friends now! by liking it



To browse more C Programs visit this link
(c) www.c-program-example.com

One comment on “C Program to implement Integration.

Leave a Reply