This is the proper formatted code of your inner most for loop:
for (d = -0.784; d <= 0.784; d = d + 0.02)
{
x1 = (int)((11*cos(d+c+b+a)+11*cos(d+c+b-a)+12*cos(c+b+a)+12*cos(c+b-a)+9*cos(b+a)+9*cos(b-a))/2);
if(x1 == x)
{
y1 = (int)((11*sin(d+c+b+a)-11*sin(d+c+b-a)+12*sin(c+b+a)-12*sin(c+b-a)+9*sin(b+a)-9*sin(b-a))/2);
if(y1 == y)
{
z1 = (int)(11*sin(d+c+b) + 12*sin(c+b) + 9*sin(b));
if(z1 == z)
{
i = 1;
goto status;
}
}
}
}
If you see, you modify
i
, only after 3 conditions are met, i.e. x1=x, y1=y, z1=z.
As long as any one of them are not same,
i
is never modified and you land up in the if condition that satisfies
i=0
If you debug, you should find that
i
might not be getting reassigned to 1 from 0.