Your question is hard to understand, but it sounds almost like you want a for
loop. E.g.
for (int x = 100; CONDITION; /* do something to x here */) {
/* use x */
}
This will start x
at 100, and continue looping while CONDITION
is true. Depending on what you replace /* do something to x here */
with, the value of x
within the loop will change each time. For a concrete example:
for (int x = 100; x < 200; x = x + 1) {
printf("%d", x);
}
will print all numbers between 100 and 199 (inclusive). Note that x = x + 1
can also be written ++x
or x++
; I wrote it longhand for clarity, since you seem to be new to C.
The above assumes you have a C99 compiler. If your complier supports only C89, you will have to declare x
at the beginning of the function and replace int x = 100
with simply x = 100
.