Use break to terminate a for loop
#include <stdio.h> int main(void) { int t; for(t = 0; t < 100; t++) { printf("%d ", t); if(t == 11) break; } return 0; }