So basically I would like to know, who is faster from these loops in C++ language? Basically, which of these examples would compile faster -
int S = 1, D = 2, d = 1;
for(int x = 0; x < 10000; x++) {
S += D/2-d *s;
}
and
int S = 1, D = 2, d = 1, x = 0;
while(x < 10000) {
x++;
S += D/2-d * S;
}