hi guys, I just wrote the below code, but matlab gives me the different result. what is the problem with the below code? I need your comments. Thanks in advance
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main(){
int i;
long double y[20000],yder[20000],t,syder[20000],sumx;
for(i=1,t=1;i<=10001,t<=2;i=i+1,t=t+0.0001){
y[i]=((1/6)*pow(t,3))+(0.5/t);}
for(i=1;i<=10000;i++){
yder[i]=(y[i+1]-y[i])/0.0001;
}
for(i=1;i<=10000;i++){
syder[i]=pow(1+(yder[i]*yder[i]),0.5);}
sumx=0;
for(i=1;i<=10000;i++){
sumx=sumx+((syder[i]+syder[i+1])*0.0001/2);
}
printf("\n%Lf",sumx);
getch();
}