mirror of
https://github.com/TheAlgorithms/C
synced 2025-02-16 21:44:16 +03:00
dont print 0 coeffs
This commit is contained in:
parent
d3d7cce24d
commit
da073120d0
@ -98,9 +98,9 @@ int main(int argc, char **argv)
|
||||
for (n = 0; n < degree; n++)
|
||||
{
|
||||
coeffs[n] = strtod(argv[n + 1], NULL);
|
||||
if (n < degree - 1)
|
||||
if (n < degree - 1 && coeffs[n] != 0)
|
||||
printf("(%g) x^%d + ", coeffs[n], degree - n - 1);
|
||||
else
|
||||
else if (coeffs[n] != 0)
|
||||
printf("(%g) x^%d = 0\n", coeffs[n], degree - n - 1);
|
||||
|
||||
/* initialize root approximations with random values */
|
||||
|
Loading…
x
Reference in New Issue
Block a user