So i have this if statement
if (c[1] < c[0] && c[2] < c[1] && c[3] < c[2] ...)
I dont know exactly how many statements it will be, it can be from 1 to 8:
if (c[1] < c[0])
if (c[1] < c[0] && c[2] < c[1] && c[3] < c[2] ... c[8] < c [7])
And i need to automate this code, but I have no idea how
Here is what i tried to do:
int i = 0;
int n; // number of statements
while(i < n)
{
if(c[i+1] < c[0])
if(c[i+2] < c[i+1])
...
i++;
}
Ps. I can only use while loop