Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PLEASE DO IT USING POINTERS AND ARRAYS. Thanks Develop a C-code to meet the requ

ID: 3708070 • Letter: P

Question

PLEASE DO IT USING POINTERS AND ARRAYS. Thanks

Develop a C-code to meet the requirements below: Find the solution of the differential equation below by using Euler's method. The range of x is 2 to 3 dy/dx-x2-3x with y-3 at x-2 2) Find the appropriate step size for this specific problem. 4) Solve the differential equation analytically and compare with the Euler's method 5) Obtain a linear regression y-ax+b and show the r2 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.

Explanation / Answer

BY USING ARRAYS AND POINTERS AS SHOWN IN BELOW

#include<stdio.h>

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: ");

    scanf("%f",&x0);

    printf("input xn: ");

    scanf("%f",&xn);

    printf("input y0: ");

    scanf("%f",&y0);

    e=euler(x0,xn,y0,n);

}

float func(float x,float y){

    return ((x*x)-(3*x));

}

float euler(float x0,float xn,float y0,int n){

    float x,y,h;

    int i;

    x=x0;

    y=y0;

    h=(xn-x0)/n;

    printf("y(%f)=%6.4f ",x0,y0);

    for(i=1;i<=n;i++) {y=y+h*func(x,y);

        x=x0+i*h;

        printf("y(%f)=%6.4f ",x,y);}

    return y;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote