Bonjour
J'ai des difficultes dans la creation d'un petit programme qui resoud l'equation ax2+bx+c=0 avec le langage c.
je vous laisse mon code bienque je sais bien qu'il est plein d'erreurs![]()
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 # include <stdio.h> # include <iostream.h> { int a,b,c,c; printf("enter a and b values"); scanf("%d",&a,&b); // now checking the value of the discriminant delta printf("%d", (b^2)-(4*a*c)); // the result of descriminant is if ((b^2)-(4*a*c)>0) printf("%d the roots", -b+(sqr(b^2-4*a*c))/2a); printf("%d the roots", -b-(sqr(b^2-v*a*c)/2a); else printf("%d there is no roots"); }
Partager