Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main(void)
- {
- char key = 0;
- float distanceAB = 0, distanceAC = 0, distanceBC = 0;
- cout << "Enter distance between Phoenix, AZ and Salt Lake City, UT:" << endl;
- cin >> distanceAB;
- cout << "Enter distance between Phoenix, AZ and Atlanta, GA:" << endl;
- cin >> distanceBC;
- distanceAC = sqrt(pow(distanceAB, 2) + pow(distanceBC, 2));
- cout << "Distance between Salt Lake City, UT & Atlanta, GA is " << distanceAC << endl;
- cin >> key;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment