Code:
#include<stdio.h>
void readdata (float*, float*, float*, float*, float*);
float area (float, float);
float weight (float, float, float, float);
void printresult (float);
/* In C, main() returns an int, not a float */
??float main(void)
{
float q1, t1, d1, id1, od1, ida1, oda1, rim1, w1;
/* what's the difference between id1 and ida1?
readdata(&q1, &t1, &d1, &id1, &od1);
rim1=area(id1, od1);
w1=weight(q1, t1, d1, rim1);
printresult(w1);
return 0;
}
void readdata (float *q1, float *t1, float *d1, float *id1, float *od1)
{
printf("Enter the Quantity, Thickness, Density, Inner Diameter, and Outer
Diameter for Washer A:\n");
scanf("%f %f %f %f %f", &q1, &t1, &d1, &id1, &od1);
}
float area (float id1, float od1);
{
float ida1, oda1, rim1;
ida1= ((id1/2)*(id1/2))*3.142
oda1= ((od1/2)*(od1/2))*3.142
rim1= oda1-ida1
/* add return rim1; */
}
float weight (float q1, float t1, float d1, float rim1)
{
/* declare w1: float w1; */
w1= q1*t1*d1*rim1
/* add return w1; */
}
void printresult (float w1);
{
printf("The weight of Washer A is: %f\n", w1);
}
make those changes and re-compile. With some compilers, you need to add include math.h, to get the floating point "package" of the compiler, to link in, but try it with and without, and see what you get.