C Programming Codes To Compute Value Using Trapezoidal Rule

C Programming Codes To Compute Value Using Trapezoidal Rule

#include<stdio.h>
#include<conio.h>
#include<math.h>
#define F(x) exp(-(x/2))
int main()
{
int a,b,h;
float i,x,y;
printf("Enter the value for lower and upper limit\n");
scanf("%d%d",&a,&b);
h=b-a;//Calculating height
x=F(a);//Calculation Function and storing in x and y.
y=F(b);
i=h*((x+y)/2);
printf("The Intregrated Value is %.3f",i);
}

Comments

Popular posts from this blog

C Program for SCAN Disk Scheduling Algorithm | C Programming

C program to Find Cartesian Product of Two Sets | C programming

C Program To Check The String Is Valid Identifier Or Not | C Programming