Every time I create a simple program for eclipse I keep getting the same error:
Symbol cout could not be resolved, and # include expects "FILENAME or < FILENAME >
I've tried using #include iostream.h
and changing that to #include <iostream>
and adding using namespace std;
to either version does not solve my issue and adds the problem: Symbol std could not be resolved.
#include <iostream>
using namespace std;
int main ()
{
double radius = 11; /*Centimeters*/
double pi = 3.14;
double sphere_volume = (4 / 3) * pi * (radius * radius * radius);
double surface_area = 5 * pi * radius;
cout << "Volume = " << sphere_volume;
cout << "Area = " << surface_area;
return 0;
}
The console should display the Volume and Area of a sphere with radius 11, but I'm not sure how to get it to accept cout so that it can print that result.