Sir, it is difficult (for me) to test your code. It does not compile with c++14 nor with c++5.1 after changing it to
#include <iostream>
#include <iomanip>
using namespace std;
float avg(int a,int b)
{
float temp = static_cast((a+b)/2);
return temp;
}
int main()
{
float m;
m = avg(1,2);
cout<<m<<endl;
return 0;
}
So I must have made an error. Would you mind to help me here?