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

I got an error, this is my program:- /******************************************

ID: 3827354 • Letter: I

Question

I got an error, this is my program:-

/********************************************************/
/*                                                      */
/*                  MAIN PROGRAM                        */
/*                                                      */
/********************************************************/
#include <stdio.h>

FILE *inptr, *outptr;

const float PI = 3.14159;
const float E = 30E06;
const int NUM = 7;


void fninput(float *, float *, float *);
void fncompute(float, float, float, float *, float *, float *);
void fnoutput(float, float, float, float, float, float);

int main ( )
{
    int count = 0;
    float load, diam, length;
    float stress, strain, elong;
  
    inptr = fopen("proj5in.dat", "r");
    outptr = fopen("proj5out.dat", "w");
  
    while(count < NUM)
    {
                fninput(&load, &diam, &length);
              
                fncompute(load, diam, length, &stress, &strain, &elong);
              
                fnoutput(load, diam, length, stress, strain, elong);
              
                count = count + 1;
    }
  
    return 0;
}

/********************************************************/
/*                                                      */
/*                  INPUT FUNCTION                      */
/*                                                      */
/********************************************************/


void fninput(float *p, float *d, float *l)
{
    fscanf(inptr, "%f %f %f", p, d, l);
  
}
/*


/********************************************************/
/*                                                      */
/*          SURAFCE AREA OF A CYLINDER CALCULATION      */
/*                                                      */
/********************************************************/

void fncompute(float p, float d, float l, float *st, float *str, float *eln)
{
     float area;
   
     area = PI * (d * d) / 4.0;
   
     *st = PI / area;
     *str = *st / E;
     *eln = l / *str;
}

/********************************************************/
/*                                                      */
/*                  OUTPUT FUNCTION                     */
/*                                                      */
/********************************************************/

void fnoutput(float p, float d, float a, float l, float st, float str, float elng)
{
     fprintf(outptr,"%12.2f   %6.2f %5.2f ", p, d, l);
}
   
   

  

objectives: Learn the following concepts and use of engineering formulas Declaration of variables Using an End-ofFile controlled while loop Use of functions Use of data files for input and output Writing assignment statement for scientific computing with equations write a c program with the following functions 1. Function to input the data 2. Function to compute the tensile stress and strain 3. Function to compute the elongation of the tensile member subject to loading 4. Function to output to a data file the tensile load, diameter, stress, strain, and the elongated length of the tensile member. The compression stress is given by the formula: o P /area. (d2/4) area TT where d the diameter of the steel member under tensile load area is cross sectional area of steel column in square inches. P is the tensile load in pounds a is compression stress in (pounds square inch) The compression strain is given by the formula: where E 30 x 106 psi modulus of elasticity Al & where & tensile strain which is dimensionless Al is the elongation of the tensile member

Explanation / Answer

try lf instead of f and you should write

fscanf(inptr,"%lf %lf %lf",&p,&d,&l);