0
چرا این کد من بالا نمی یاد؟
https://code.sololearn.com/cPuFvrGpGksZ/?ref=app https://www.sololearn.com/discuss/1496744/?ref=app
4 Answers
0
مشکل این کد چیه؟
+ 2
#include <stdio.h>
#include <math.h>
int main()
{
    float a, b, c, d, x1, x2;
    scanf("%f", &a);
    printf("a = %f\n", a);
    
    scanf("%f", &b);
    printf("b = %f\n", b);
    
    scanf("%f", &c);
    printf("c = %f\n", c);
 
    printf("debugging - line 1\n");
    float delta = b * b - 4 * a * c;
    
    if (delta >= 0) {
        d = sqrt(delta);
        printf("debugging - line 2\n");
        x1 = (-b + d) / (2 * a);
        printf("debugging - line 3\n");
        x2 = (-b - d) / (2 * a);
  
        printf("\nx1 = %f    x2 = %f", x1, x2);
    }
    else
        printf("has imaginary root");
}
0
https://code.sololearn.com/cJ1u0WS3HbVb/?ref=app
برید توی این لینک کد من باز میشه ولی وقتی ران می کنید
0
بالا نمیاد



