Advertisement
dllbridge

Untitled

Oct 24th, 2020
1,882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1.  
  2.  
  3. #include       <stdio.h>
  4.  
  5. #include       <math.h>
  6.  
  7.  
  8. float D   =  81.0,
  9.       a   = 2,
  10.       b   = 8,
  11.       c   = 0,
  12.       res = 0.2;
  13.  
  14.  
  15.  
  16. ////////////////////////////////////////////////////
  17. int main()                                        //
  18. {
  19.  
  20.     D = (b*b) - (4*a*c);
  21.  
  22.     if(D < 0)
  23.     {
  24.    
  25.        printf("D = %.2f  (less than zero) \n", D);
  26.        printf("No solution ! \n");
  27.        return 0;
  28.     }
  29.  
  30.     res = sqrt(D);
  31.  
  32.     printf("sqrt %.2f = %.2f", D, res);
  33.  
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement