Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago