@destruction
I think it is because of the following reason. See in the main program, $i$ has an even sequence. $i=0,2,4,6,8,…,198$
Now suppose for example, $z=100$, then the block under $\text{if (z>i)}$ should work for $i=0,2,4,6,8,98$ and the block under else should work for the other values of $i=100, 102,...,198$.
Now suppose for example, $z=101$, then the block under $\text{if (z>i)}$ should work for $i=0,2,4,6,8,98,100$ and the block under else should work for the other values of $i=102, 104,...,198$.
Based on this I feel that the first loop shall be:
for( i=0;i<z;i+=2)
{
p=p+t1;
q=q+t2;
}
And the second loop shall be :
for( i=z+ (z%2) ;i<200;i+=2)
{
p=p+t3;
q=q+t1;
}
// such that for z=100. the loop starts with z=100. But if z=101. the loop starts with z=102