Knowing which way to iterate the for loop C I want the code to automatically know which way to iterate through the loop without manually adding the '>' or '&lt;' sign. 
I am using the logic that if the setup part of the loop is smaller than the value in the  test expression, then the sign used will '&lt;' and will be '>' vice versa.

The current way I have gone around this is by wrapping the for loop in an if statement, however this looks incredibly bulky and I feel there must be a better way.

The following is the code I am currently using: 

i = -1;

if ((i*i*i)&lt;(i * i * (i + i + i + i + i))){
    for (integer = i * i * i; integer &lt; i * i * (i + i + i + i + i);integer += i * i * i * i * i) {
        printf("%d",integer);
        printf("\n");
    }
}
else {
    for (integer = i * i * i; integer &gt; i * i * (i + i + i + i + i);integer += i * i * i * i * i) {
        printf("%d",integer);
        printf("\n");
    }
}


And here is an example which looks simpler:

if (-1&lt;-5){
for (integer = -1; integer &lt; -5;integer += -1) {
    printf("%d",integer);
    printf("\n");
}
}

else{
    for (integer = -1; integer &gt; -5;integer += -1) {
        printf("%d",integer);
        printf("\n");
    }
}
You have a really complicated example with variables, and a simpler one with literals. The literal one is only going to use one branch. So let's do a simple one with variables. Let's say you want to iterate from a to b, but you don't know which is larger. Well, first of all, unless I'm missing something, if a>b, then you'll want integer -= increment in the second branch, while your code has integer += increment in both. So before your for-loop, define a variable direction equal to the sign of b-a (that is, if b-a &gt;0 then direction = 1, if b-a&lt;0 then direction = -1). Then do:

for(integer = a; (b-integer)*direction &gt; 0; integer += direction*increment)