Just started learning c++ got this error:
C:\Users\KC\Documents\Math.cpp|9|error: invalid type argument of unary '*' (have 'double')|
This is the code:
#include <iostream>
#include <cmath>
#define M_PI
using namespace std;
int main()
{
double area, radius = 1.5;
area = M_PI * radius * radius;
cout << area << "\n";
}
can someone explain to me what did I do wrong. Thanks