Question: I am trying to find out the c code with use of arrays and pointers etc. the directions are in the picture i attempted it

 I am trying to find out the c code with use
I am trying to find out the c code with use of arrays and pointers etc. the directions are in the picture i attempted it and got me the answer but it needs pointers and arrays. Please help and have a copyable code. Below is what i have so far.
#include
float func(float x,float y);
float euler(float x0,float xn,float y0,int n);
int main()
{ float x0,xn,y0,e;int n;
printf(" inputn: ");
scanf("%d",&n);
printf("input x0,xn: ");
scanf("%f,%f",&x0,&xn);
printf("input y0: ");
scanf("%f",&y0);
e=euler(x0,xn,y0,n);
}
float func(float x,float y)
{
return x*x-x;
}
float euler(float x0,float xn,float y0,int n)
{ float x,y,h;
int i;
x=x0; y=y0; h=(xn-x0);
printf("y(%f)=%3.4f ",x0,y0);
for(i=1;i
y=y+h*func(x,y);
x=x0+i*h;
printf("y(%f)=%3.4f ",x,y);
}
return y;
}
Develop a C-code to meet the requirements below: 1) Find the solution of the differential equation below by using Euler's method. The range of x is 5 to 6. dy/dx=x2-x with y=3 at x=5 2) Find the appropriate step size for this specific problem. 3) Print all the y values within the range of x#5 to x 6. 4) Solve the differential equation analytically and compare with the Euler's method 5) Obtain a linear regression y-ax+b and show the r value Your C-code must contain the following features: (1) use of arrays, (2) use of pointers, (3) use of structure, (4) use of union, (5) use of functions and function calls, (6) formatted output on screen and (7) saving of the same output on a file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!