How would you apply this formula to c++ program?
t=2π√L/g
Printable View
How would you apply this formula to c++ program?
t=2π√L/g
What do you mean? You want to write it as a C statement?
I'm going to give you an example of a math statement, not exactly the statement of what you are asking for, as that would be "solving the equation for you":
--Code:// Calculate the distance from 0,0 to x, y, using Pythagoras' method
double distance(double x, double y)
{
double dist;
dist = sqrt(x * x + y * y);
return dist;
}
Mats
What are you having trouble with ? What have you tried ?