Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Swedish Explanation! */
- #include <iostream>
- #include <stdlib.h>
- #include <cmath> //Acquire hypot() function/method.
- using namespace std;
- int main()
- {
- /*Räkna ut längden av hypotenusan på en rätvinklig triangel.*/
- float x = 6;
- float y = 8;
- cout << hypot(x, y) << endl;
- /*
- Algoritm:
- x*x = 6*6 = 36
- y*y = 8*8 = 64
- 36 + 64 = 100
- Square Root of 100 = 10
- Answer: 10
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement