How would you apply this formula to c++ program?

t=2π√L/g

Printable View

- 03-26-2008farah0718applying formula help please
How would you apply this formula to c++ program?

t=2π√L/g - 03-26-2008matsp
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 - 03-26-2008Desolation
What are you having trouble with ? What have you tried ?