diff --git a/physics/find_max_height.cpp b/physics/find_max_height.cpp new file mode 100644 index 00000000000..9c1d2413a1e --- /dev/null +++ b/physics/find_max_height.cpp @@ -0,0 +1,15 @@ +#include +using namespace std; + +int main() { + double velocity, gravity = 9.8, maxHeight; + + cout << "Enter the initial velocity of the ball (m/s): "; + cin >> velocity; + + maxHeight = (velocity * velocity) / (2 * gravity); + + cout << "The maximum height the ball will reach is: " << maxHeight << " meters." << endl; + + return 0; +}