As you can probably tell by my code, I'm a C++ beginner, practicing functions/return statements. I've attempted to create a basic program that calculates the area of a circle using the radius, which is given through user input. For some reason, the program always returns a 1? No doubt I've missed something simple, but for the life of me I can't see any problems?
#include<iostream>
#include<math.h>
using namespace std;
double areaofcircle(double Radius) {
return M_PI * pow(Radius, 2);
}
int main () {
double Radius;
cout << "Enter the radius of your circle \n";
cin >> Radius;
cout << "The area of your circle equals " << areaofcircle;
return 0;
}