Hi
My elementary programming skills which I acquired not long ago are very much rusty these days. I was practicing with the code below but I received those two errors about the line at #17 in the source code. Would you please help me?
I remember when I started posting here people would tell me that my code isn't properly organized, like braces are not aligned etc. They used to use a certain term. What is it? Please tell me. Thank you for all the help.
Code:
//define_pi.cpp
// learning to use #define on Pi
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
float r, area;
#define pi = 3.142;
cout << "enter radius"; cin >> r;
area = 2*pi*r;
cout << "area is: " << area << endl;
system("pause");
return 0;
}
Errors:
Code:
17|error: expected primary-expression before '=' token|
17|error: invalid type argument of 'unary *'|