There is a error that I can not see...

/* I am sorry there are some parts of the algorithm that are in Portuguese, whereas I am from Mozambique. When I compile, it appears the following: C:\Dev-Cpp\Makefile.win [Build Error] ["Equação quadratica2.o"] Error 1. I do not know what is happening. I would appreciate if someone could help me.*/


#include <stdio.h>
#include <conio.h>
#include <math.h>

int main (){

float a, b, c, delta, X1, X2;

printf("Introduza o valor de a: ");
scanf("%f", &a);
printf("Introduza o valor de b: ");
scanf("%f", &b);
printf("Introduza o valor de c: ");
scanf("%f", &c);

if (a != 0){
delta = (b*b) -4*a*c;
if (delta == 0){
X1 = -b/2*a;
printf("Delta é igual a zero \n");
printf("X1 e X2 = %f", X1);
}
else {
if (delta>0){
X1 = ((b*b) + sqrt(delta))/2*a;
X2 = ((b*b) - sqrt(delta))/2*a;
printf("Delta maior que zero \n");
printf("X1 = %f\n", X1);
printf("X2 = %f", X2);
}
else{
printf("Delta menor que zero \n");
printf("A equação nao tem raizes reais");
}
}
}
else {
printf("Nao é uma equação quadratica \n");
printf("O valor de a tem que ser diferente de zero");
}


}
Last edited on
Rip out that reference to conio.h

If it still doesn't work, the problem isn't in the code.

Also, don't use Dev-Cpp. It's very, very bad.
I have done it...but there is still the problem.

What can I use instead of the Dev-Cpp?
Topic archived. No new replies allowed.