Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- float a; //a i b are legs
- float b;
- float c; //c = hypotenuse
- printf("a = ");
- scanf("%f", &a);
- printf("b = ");
- scanf("%f", &b);
- c = (sqrt(pow(a,2)+pow(b,2))); //hypotenuse
- printf("%f\n", c);
- float alfa = acos(a/c)*180/M_PI;
- float beta = acos(b/c)*180/M_PI;
- printf("%f\n", alfa);
- printf("%f\n", beta);
- if (alfa + beta == 90)
- {
- printf("\nJest okay");
- }
- else
- {
- printf("Nie jest OKEJ\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement