Tsallaka zuwa abun ciki
Justice Tech School

break and continue

break exits a loop and continue skips to the next round.

Example
#include <stdio.h>

int main(void) {
  for (int i = 1; i <= 6; i++) {
    if (i == 2) continue;
    if (i == 5) break;
    printf("%d ", i);
  }
  printf("\n");
  return 0;
}

Result

1 3 4 

Exercise

Skip a round.

;

Quiz Test

Which exits the loop?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.