PGM 2
PGM 2
PGM 2
#include <stdio.h>
int length = 0;
length++;
return length;
int i, j;
j = 0;
j++;
if (pattern[j] == '\0') {
return i;
}
// Pattern not found
return -1;
int i;
str[patternIndex + i] = replace[i];
int main() {
char mainString[MAX_LENGTH];
char pattern[MAX_LENGTH];
char replace[MAX_LENGTH];
mainString[stringLength(mainString) - 1] = '\0';
pattern[stringLength(pattern) - 1] = '\0';
replace[stringLength(replace) - 1] = '\0';
if (patternIndex != -1) {
} else {
return 0;
OUTPUT:
Horse Riding
Greek