I would like to know why, when I type in the program below, it checks if the number entered is triangular, that is, it is a multiple of three consecutive numbers, for example 60 it prints two "NO" and one "YES", and when I type 336 do five "NAO" and a "YES" appear?
#include <stdio.h>
int main(void)
{
int numero, i;
scanf("%d",&numero);
for(i = 1 ; i*(i+1)*(i+2)<=numero ; i++)
{
if(i*(i+1)*(i+2)==numero)
{
printf("SIM\n");
}
else
{
printf("NAO");
}
}
return 0;
}