#include <stdio.h>

int main() {
  int i;

  // use a break statement to exit a for loop
  for (i = 0; i < 10; i++) {
    if (i == 5) {
      break;
    }
    printf("i = %d\n", i);
  }

  // use a continue statement to skip the remainder of the current iteration of a while loop
  while (i < 10) {
    i++;
    if (i % 2 == 0) {
      continue;
    }
    printf("i = %d\n", i);
  }

  return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: