Problem with delta0 output

1

Good evening, I'm having trouble with the output of my program that printed on the screen the roots of the equation of the second degree. When I go to the condition of:

if (delta<0) //Condicao caso o delta seja menor que zero
{  
    printf("Sem raiz"); //Impressao de um resultado invalido
}

The output of the program is as follows:

Sem raiz0.0000
0.0000
    
asked by anonymous 23.03.2015 / 01:11

1 answer

1

Only with the part you've posted from the code, it's tricky to help. The impression you give is that a else is missing to show the results only if the delta is zero or more.

Something like this:

if (delta<0) //Condicao caso o delta seja menor que zero
{  
    printf("Sem raiz"); //Impressao de um resultado invalido
}
else
{
    // aqui vai o printf que mostra as raízes, que só aparecerão se
    // a condição anterior for falsa, graças ao else.
}
    
23.03.2015 / 01:16