please help :)

so im trying to do this mathematical equation and it just wont seem to work
can anyone please tell me what im doing wrong? thank you :) oh and im using iostream, iomanip, and cmath

float long d, deg, Q1, Q2, Q3, Q4;
float dc;
float const g = 9.8;

cout << "Please input the angle in degrees" << endl;
cin >> deg;

cout << "Please input the Diameter in meters" << endl;
cin >> d;


// Calculations

dc = d / 2*(-cos(deg));

Q1 = ((2^(2/3))*(dc^(5/2)));

Q2 = (sqrt((g)*(deg-0.5*sin(2*deg))^(3/2)));

Q3 = 8 * sqrt(sin(deg)*(1-cos(deg))^(5/2));

Q4 = (Q1 * Q2)/Q3;

cout << "The flow rate is: " << Q4 << endl;

What is not working?

Though I can already imagine it.

Put an f after all your integer constants, like when writing 2/3, write 2f/3f instead - otherwise an integer division 2/3 is performed, which is 0.
well its saying that in Q2 at (g) the expression must have a integral or enum type
and at Q3 sqrt(sin it says double__decl sin(double_X) the expression must have a integral or enum type
i am fairly new to coding so could you tell me exactly what to do? :)
Ah well, I missed something:

You can't use the ^ operator like that in C++. ^ is binary XOR. You need to use the pow(base, exponent) function from cmath.
Topic archived. No new replies allowed.