In C programing with comments

1 answer below »
Answered Same DayApr 12, 2021

Answer To: In C programing with comments

Arun Shankar answered on Apr 13 2021
130 Votes
equation.txt
3.5*x^3+2.7*x^2+0.5*x+36
0.0 4.0 0.5
main.c
#include
#include

#include
#include
char getChoice()
{
char c;
printf("\na. Enter File Location (fullpath)");
printf("\nb. Display the equation");
printf("\nc. Display the table");
printf("\ne. Exit");
printf("\n\nEnter a choice a, b, c, or e: ");
scanf("\n%c", &c);
return c;
}
double f(double m, double n, double p, double l, double x)
{
return (m * x * x * x) + (n * x * x) + (p * x) + l;
}
int readFromFile(double* aptr, double* bptr, double* cptr, double* dptr, double* minptr, double* maxptr, double* incrptr)
{
char filename[100];
printf("Enter filename: ");
scanf("%s", filename);
FILE* fp = fopen(filename, "r");
if(!fp)
{
printf("\nERROR: Unable to open the file");
return 0;
}
// File opened. Read the equation
char equation[100];
fscanf(fp, "%s",...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here