Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // my second program in C++
- #include <stdio.h>
- #include <math.h>
- #include <iostream>
- using namespace std;
- int main ()
- {
- double X = 6.66;
- double Y = 5.44;
- double Z = 2.33;
- double velocity;
- velocity = sqrt(pow(Z,2)+pow(Y,2)+pow(Z,2)); // actual air speed
- cout << "X speed: " << X << endl;
- cout << "Y speed: " << Y << endl;
- cout << "Z speed: " << Z << endl;
- cout.precision(3); // for 2 decimal places.
- cout << "Velocity: " << velocity << endl;
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement