Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define NUM 108
- double startX, deltaX, endX;
- double function1(double x) {
- return log(1 - NUM / sin(x));
- }
- double function2(double x) {
- return tan(x) / NUM;
- }
- double decideFUNC(){
- double x, f1, f2;
- for(x = startX; x <= endX; x += deltaX) {
- f1 = function1(x);
- f2 = function2(x);
- if (f1 == f2) { // вряд ли мы сюда попадем
- printf("max values are the same %fn", f1);
- } else {
- if (f1 > f2)
- printf("x = %f, f1 = %f (%f, %f)n", x, f1, f1, f2);
- else
- printf("x = %f, f2 = %f (%f, %f)n", x, f2, f1, f2);
- }
- }
- }
- int main()
- {
- scanf("%f", &startX);
- deltaX = 4;
- endX = 100;
- decideFUNC();
- return 0;
- }
Add Comment
Please, Sign In to add comment