Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- double f(double u , double v)
- {
- return pow(sin(2*u),2) + log(v);
- }
- int main()
- {
- double max = f(1.5,1.5);
- double min = f(1.5,1.5);
- for(double u = 1.5; u <= 2.0; u+=0.25)
- {
- for(double v = 1.5; v <= 2.0; v+=0.45)
- {
- double temp = f(u,v);
- if(temp>max)
- {
- max = temp;
- }
- if(temp<min)
- {
- min = temp;
- }
- printf("u = %.2lf ,v = %.2lf ,f(u,v) = %lf\n",u,v,temp);
- }
- printf("\n");
- }
- for(double u = 1.5; u <= 2; u+=0.25)
- {
- double temp = f(u,2.0);
- if(temp>max)
- {
- max = temp;
- }
- if(temp<min)
- {
- min = temp;
- }
- printf("u = %.2lf ,v = %.2lf ,f(u,v) = %lf\n",u,2.0,temp);
- }
- printf("min = %lf\nmax = %lf\n",min,max);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement