INTEGRATION 0 3 C LANGUAGE
#include<stdio.h>
#include <math.h>
int main()
{
float x,y;
float rect_wight=0.0001;
float area;
int upper_limit, lower_limit;
printf("Enter upper Limit and Lower Limit\n");
scanf("%d %d",&lower_limit,&upper_limit);
for(x=lower_limit;x<=upper_limit;x=x+rect_wight){
y=pow(x,2)+1;
area = area + y*rect_wight;
printf("x:%f y:%f \n",x,y,area);
}
printf("Area under this curve is: %f\n",area);
return 0;
}
Comments
Post a Comment