attached is the q of the c program....and
here's what i try to write out...
may i know how should i write to prompt user to enter the four weights from the keyboard. and the program should print an error message if the weights are out of range?
Here's my program
#include<sdtio.h>
floatx[4] = {1.2,2.4,3.6,4.8};
float f[4] = {0.1,0.2,0.3,0.4};
main()
{
int i;
for (i=0; 1<4;i++) ftotal+ = f;
if(ftotal!=1.0)
{
printf("error\n");
exit();
}
for(i=0;1<4;i++) xave+=f *x;
printf("\nThe weights are %f"&f);
printf("\nThe average is %f\n",xave);
please advise me. Thanks.