Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- int a,b,c,del;
- scanf("%d",&a);
- scanf("%d",&b);
- scanf("%d",&c);
- del=(b*b)-4*a*c;
- if(del<0)
- {
- printf("il n'y a pas de solution pour cette equation");
- }
- else
- {
- if(del==0)
- {
- printf("x=%f",-b/(2*a));
- }
- else
- {
- if(del>0)
- {
- printf("x1=%f et x2=%f",(-b-sqrt(del))/(2*a),(-b+sqrt(del))/(2*a));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement