A simple for loop
#include <stdio.h> int main(void) { int i; /* count by 2s */ for( i = 0; i < 100; i += 2) printf("%d ", i); return 0; }