Hello everyone,
I faced with this error "void value not ignored as it ought to be ".
Could you please help me to fix it?
Thanks in advance.
#include <iostream>
#include <math.h>
using namespace std;
void avg(int theArray[], int sizeofArray);
int main()
{
int numbers[5]={12,21,32,43,54};
int total=avg(numbers,5);
int cal_avg;
cal_avg=total/5;
cout<<"cal_avg"<<cal_avg<<endl;
return 0;
}
void avg(int theArray[], int sizeofArray)
{
int sum=0;
for (int i=0; i<sizeofArray; i++)
{
sum+=theArray[i];