Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #define K 22.5
  4. #define L 7.5
  5.  
  6. int main(){
  7.     double a,b,x,y;
  8.     printf("Please type your x value:");
  9.     scanf("%f",&x);
  10.     a=pow(pow(K,-1/2)-(L*pow(x+2.84,1/2)),2);
  11.     b=(-log10(x)+exp(x));
  12.     if(a>b){
  13.         y=(4*a+3*b)/(pow(a,2)+pow(b,2));
  14.         printf("Your x:%f\nYour y:%f",x,y);
  15.         getch();
  16.     }else if(a<=b){
  17.         y=fabs(a-b);
  18.         printf("Your x:%f\nYour y:%f",x,y);
  19.         getch();
  20.     }else{
  21.         printf("Error");
  22.         getch();
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement