0
Someone help me, how can I resolve this error:[Error] lvalue required as left operand of assignment
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
main ()
{
setlocale(LC_ALL, "Portuguese");
/* Descubra seu os numeros formam um triangulo
Programado por Wesley*/
int a, b, c;
printf("Descubra se seus numeros formam um triangulo\n");
printf("Informe o valor do primeiro lado: ");
scanf("%d", &a);
printf("Informe o valor do segundo lado: ");
scanf("%d", &b);
printf("Informe o valor do terceiro lado: ");
scanf("%d", &b);
if (a < b + c && b < a + c && c < a + b)
{
if (a = b && b = c)
{
printf("Estes valores formam um triangulo equilátero\n");
}
else if (a = b && b = c && a = c)
printf("Estes valores formam um triangulo isóceles\n");
else
pritnf("Estes valores formam um triangulo escaleno\n");
}
else
{
printf("Estes valores não formam um triangulo!\n");
}
}
actually the main function type is always "int"...gcc always complained, and still complains, of "void main", Microsoft always accepted (I used so)...from C99 it is mandatory to put the return type of a function in its statement...the "Return 0" is optional, even when using "int main"...and the correct type of main in C is "int main(void)"...in C when declaring a function with parameters "()" instead of "(void)" the meaning is slightly different from C++ ... this OS question has more details
– zentrunix