Hello,
I am trying to solve an equation using c programming. Basically I need to write a program that calulates solutions to the equation for a range of values of x, where x >0. I am new to c programming and would appreciate some help. I am trying to use arrays for the x values and a for loop so that it cycles through all the possible scenarios. I then want to print this to a file so that it can be imported to excel.
Thanks for any help,
Z
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double y_value[100];
double x_value[100];
int n1;
int a;
a=0.4+(8039/25000);
for(n1=0;n1<100;n1++)
{
x_value[n1]=0 + (double)n1*0.02;
y_value[n1]=function(x_value[n1];
}
for(n1=0;n1<10;n1++)
{
printf("%g\t %g\n",x_value[n1],y_value[n1]);
}
return 0;
}
Is what I have so far, am unsure of how to define the function so it gets the result I want