Advertisement
evgenko

Leo_H_lab7_2

Dec 13th, 2017
79
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.  
  4. int main()
  5. {
  6.     float x,h;
  7.     printf("Enter the xmin: ");
  8.     scanf("%f",&x);
  9.     printf("Enter the h: ");
  10.     scanf("%f",&h);
  11.     for (float i=0;i<10;i++,x+=h){
  12.         float a,y;
  13.         printf("Enter the a: ");
  14.         scanf("%f",&a);
  15.         if ((10-x)==fabs(a)){
  16.             y=pow(x,a);
  17.         }else{
  18.             if((10-x)<fabs(a)){
  19.                 y=15/a;
  20.             }else{
  21.                 y=a-x;
  22.             }
  23.         }
  24.         printf("%f || %f\n",x,y);
  25.  
  26.     }
  27.     return 0;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement