Advertisement
M1RAI

EXERCICE5

Nov 8th, 2020
1,861
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 <stdlib.h>
  3. #include <math.h>
  4. int main()
  5. {
  6.     int a,b,c,del;
  7.     scanf("%d",&a);
  8.     scanf("%d",&b);
  9.     scanf("%d",&c);
  10.     del=(b*b)-4*a*c;
  11.     if(del<0)
  12.     {
  13.         printf("il n'y a pas de solution pour cette equation");
  14.     }
  15.     else
  16.     {
  17.         if(del==0)
  18.         {
  19.             printf("x=%f",-b/(2*a));
  20.         }
  21.         else
  22.         {
  23.             if(del>0)
  24.             {
  25.                 printf("x1=%f et x2=%f",(-b-sqrt(del))/(2*a),(-b+sqrt(del))/(2*a));
  26.             }
  27.         }
  28.     }
  29.  
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement