I am using TurboC. What's wrong with this code? During the runtime, the message was "floating point formats not linked" "Abnormal program termination". I am a newbie in C language, and I've never encountered this kind of error before. Thanks in advance!
/* averages arbitrary number of temperatures */
/* uses pointer notation */
main()
{
float temper[40]; /* Array declaration */
float sum=0.0;
int num, day=0;
do /* Puts temps in array */
{
printf("Enter temperature for day %d: ", day);
scanf("%f", temper+day);
}
while( *(temper+day++) > 0 );
num = day-1; /* number of temps entered */
for(day=0; day<num; day++) /* calculate average */
sum += *(temper+day);
printf("Average is %.1f", sum/num);
getche();
}