Help on math

I'm making this program wich will calculate the volume, surface and areal (2D) af a circle when given a radius. But I'm having some trouble with the code.

This is the function CalcVol:
1
2
3
4
5
6
7
8
9
10
11
#include <cstdlib>
#include <iostream>
using namespace std;


double CalcVol(double ra)
{
    double Volume;
    Volume = (4/3)*3.14159265*(ra^3);
    return Volume;
}


11 C:\Dev-Cpp\CalcVol.cpp invalid operands of types `double' and `int' to binary `operator^'

What can I do?
ra^3 means ra XOR 3. Not ra powered to the third. Use instead pow() function from cmath library or simply ra*ra*ra.
Thanks, it fixed it!
Topic archived. No new replies allowed.