Design and code a C function named roots that calculates the roots of  translation - Design and code a C function named roots that calculates the roots of  Vietnamese how to say

Design and code a C function named

Design and code a C function named roots that calculates the roots of a quadratic equation. Your function receives three doubles that hold the coefficients of the quadratic equation and returns through two other double parameters the real roots of the equation. The function returns the number of real roots as the return value of the function itself. The header for your function looks something like

int roots(double a, double b, double c, double *x1, double *x2)

Consider the quadratic equation:
f(x) = a * x2 + b * x + c

where a, b and c are constant coefficients. This equation may have up to 2 real roots. The roots are the values of x for which
a * x2 + b * x + c = 0
The roots are given by the equations
x1 = ( - b + sqrt( D ) ) / ( 2 * a )
x2 = ( - b - sqrt( D ) ) / ( 2 * a )
where D is the discriminant
D = b2 - 4 * a * c
If D is positive-valued, there are 2 real roots. If D is zero-valued, there is one real root. If D is negative-valued, there are no real roots.
If there is one real root, set x1 to its value and leave x2 unchanged. If there are no real roots, leave x1 and x2 unchanged.
The output from your program looks something like
0/5000
From: -
To: -
Results (Vietnamese) 1: [Copy]
Copied!
Design and code a C function named roots that calculates the roots of a quadratic equation. Your function receives three doubles that hold the coefficients of the quadratic equation and returns through two other double parameters the real roots of the equation. The function returns the number of real roots as the return value of the function itself. The header for your function looks something like int roots(double a, double b, double c, double *x1, double *x2) Consider the quadratic equation: f(x) = a * x2 + b * x + c where a, b and c are constant coefficients. This equation may have up to 2 real roots. The roots are the values of x for which a * x2 + b * x + c = 0The roots are given by the equations x1 = ( - b + sqrt( D ) ) / ( 2 * a ) x2 = ( - b - sqrt( D ) ) / ( 2 * a )where D is the discriminant D = b2 - 4 * a * cIf D is positive-valued, there are 2 real roots. If D is zero-valued, there is one real root. If D is negative-valued, there are no real roots. If there is one real root, set x1 to its value and leave x2 unchanged. If there are no real roots, leave x1 and x2 unchanged. The output from your program looks something like
Being translated, please wait..
Results (Vietnamese) 2:[Copy]
Copied!
Thiết kế và mã một hàm có tên là C rễ mà tính toán gốc rễ của một phương trình bậc hai. Chức năng của bạn nhận được ba đôi mà giữ các hệ số của phương trình bậc hai và trả về thông qua hai thông số đôi khác nguồn gốc thực sự của phương trình. Hàm trả về số lượng các nguồn gốc thực sự là giá trị trả về của hàm. Các tiêu đề cho chức năng của bạn trông giống như int rễ (double a, double b, double c, double * x1, double * x2) Xem xét các phương trình bậc hai: f (x) = a * x2 + b * x + c trong đó a, b và c là các hệ số không đổi. Phương trình này có thể có đến 2 nguồn gốc thực sự. Rễ là các giá trị của x mà một * x2 + b * x + c = 0 rễ được cho bởi phương trình x1 = (- b + sqrt (D)) / (2 * a) x2 = (- b - sqrt (D)) / (2 * a) trong đó D là biệt thức D = b2 - 4 * a * c Nếu D là tích cực có giá trị, có 2 nguồn gốc thực sự. Nếu D là số không có giá trị, có một gốc rễ thật sự. Nếu D là tiêu cực có giá trị, không có nguồn gốc thực sự. Nếu có một gốc rễ thực, để x1 giá trị của nó và để lại x2 không thay đổi. Nếu không có nguồn gốc thực sự, để lại x1 và x2 không thay đổi. Các đầu ra từ chương trình của bạn trông giống như
















Being translated, please wait..
 
Other languages
The translation tool support: Afrikaans, Albanian, Amharic, Arabic, Armenian, Azerbaijani, Basque, Belarusian, Bengali, Bosnian, Bulgarian, Catalan, Cebuano, Chichewa, Chinese, Chinese Traditional, Corsican, Croatian, Czech, Danish, Detect language, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Frisian, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hausa, Hawaiian, Hebrew, Hindi, Hmong, Hungarian, Icelandic, Igbo, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Korean, Kurdish (Kurmanji), Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Myanmar (Burmese), Nepali, Norwegian, Odia (Oriya), Pashto, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Samoan, Scots Gaelic, Serbian, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenian, Somali, Spanish, Sundanese, Swahili, Swedish, Tajik, Tamil, Tatar, Telugu, Thai, Turkish, Turkmen, Ukrainian, Urdu, Uyghur, Uzbek, Vietnamese, Welsh, Xhosa, Yiddish, Yoruba, Zulu, Language translation.

Copyright ©2025 I Love Translation. All reserved.

E-mail: