insert
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
main ()
{
double a,b,x;
printf("range[a,b]=");
scanf("%lf %lf",&a,&b);
printf("input [a,b]=(%lf %lf)\n",a,b)
if (a>b)
{
printf("error:a>b\n");
exit(1);
}
FILE *fd;
if((fd=fopen("sample.txt","w"))==NULL)
{
printf("cannot open file.\n");
}
x=a;
while(x<=b)
{
fprintf(fd,"%lf\t%lf\n",x,(3+exp(0.5*x))/0.3*x*X+25*x+1.6));
x=x+(b-a)/1000;
}
close(fd);
exit(0);
}
This is the source code for the first problem, is it correct? how can i do the flow charts and documentation?