FOR (INT I = 0; I <= N - M; I++) {
INT J;
/* FOR CURRENT INDEX I, CHECK FOR PATTERN MATCH */
FOR (J = 0; J < M; J++)
IF (TXT[I + J] != PAT[J])
BREAK;
IF (J == M) // IF PAT[0...M-1] = TXT[I, I+1, ...I+M-1]
PRINTF("PATTERN FOUND AT INDEX %D N", I);
}; IF (SUB IN STR):