I wanted to make a program which obtains temperature of each day of 2 months
and prints the average for each day
The error code is at the line where the day_avg() is called.
(Cannot Cast float to float*)
#include <stdio.h>
void day_avg(float month[],float month2[]);
int main()
{
float jul[31]={ 31,28,31,30,31,30,31,31,30,31,30,31 };
float aug[31]={ 31,28,31,30,31,30,31,31,30,31,30,31 };
day_avg(jul[31],aug[31]);
}
void day_avg(float month[],float month2[]){
int i;
float avg[31]={0};
for(i=0;i<31;i++)
avg[i]=(month[i]+month2[i])/2.0;
for(i=0;i<31;i++)
printf("\nAverage of temperature of 2 months for day %d :%.1f",i+1,avg[i]);
}