I didn't test the program, but here's what i think it's doing... (by the way, when you have this kind of problem (infinite loop), you should try using your debugger in mode "step by step", can be really useful, in fact, it will give you the answer right over so...).
Your fonction is looping infinitely because you are telling it to do so... you'll never converge with a condion such as
Code:
int Option1(int num)
{
if(num%2 == 0)
{
num = num/2;
printf("\nNext value: %d", num);
Option1(num);
}
if(num%2 != 0)
{
num = num*3+1;
printf("\nNext value: %d", num);
Option1(num);
}
// ...
}
Take num == 1 and look...
Code:
1 % 2 == 1
= <enter second if>
4 = 3 + 1
= <recursive call with num == 4>
4 % 2 == 0
= <enter the first if>
2 = 4 / 2
= <recursive call with num == 2>
2 % 2 == 0
= <enter first if>
1 = 2 / 2
= <recursive call with num == 1>
1 % 2 == 1
= <enter second if>
4 = 3 + 1
= <and on and on and on....>
Also, this will not resolve your problem but consider an else-if instead of two if.