Im fairly new to coding. I am doing a project with function calls, and my POW() and SQRT() functions say they're not declared in this scope. I'm not particularly sure how to solve this compiler error and appreciate any feedback
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
using namespace std;
double average(double a,double b, double c, double d);
void stdev(double a, double b, double c, double d);
int main(){
double num1,num2,num3,num4;
char repeat;
do{
cout << "Enter four decimal numbers: ";
cin >> num1 >> num2 >> num3 >> num4;
average(num1, num2, num3, num4);
stdev(num1,num2,num3,num4);
cout << "Please enter y to continue: ";
cin >> repeat;
cout << endl;
}
while (repeat == 'y');
return 0;
}
double average(double a, double b, double c, double d){
double ave;
ave = (a+b+c+d)/4;
return ave;
}
void stdev(double a, double b, double c, double d, double average){
double std, ave;
std = SQRT(POW(a-ave,2)+POW(b-ave,2)+POW(c-ave,2)+POW(d-ave,2));
cout << "The average = "<< ave << endl;
cout << "The standard deviation of these numbers = "<<std<<endl;
return;
}
sqrt and pow must be in lowercase and you also missed average on stdev function definition. https://www.cplusplus.com/reference/cmath/