I'm having trouble creating a program that prints if the number you typed is triangular or not. How do I proceed to create an indefinite sequence for a large number within the conditional?
#include <stdio.h>
int main (void)
{
int num, i, aux;
scanf("%d", &num);
num = n*(n + 1)/2;
for(i = 1; i + (i + 1)<=num; i++ )
{
if(i + (i + 1) + (i + 2) == num)
aux = 1;
}
if (aux)
{
printf("SIM");
}
else
{
printf("NAO");
}
return 0;
}