The program I created receives three integer values, calculates the values inside% cos_de% and if the condition is correct it should show the SIM (the triangle is a rectangle), and if the condition is not satisfied, it should show NO.
By typing values 3, 4 and 5 the output must be YES, typing 3, 3 and 4, the output should be NAO, but this is giving YES in all cases.
Follow the code:
#include <stdio.h>
#include <math.h>
int main (void)
{
int hip, cat1, cat2;
scanf("%d", &cat1);
scanf("%d", &cat2);
scanf("%d", &hip);
if (hip = pow(cat1,2) + pow(cat2,2))
{
printf("SIM");
}
else
{
printf("NAO");
}
return 0;
}
How to solve?