p17 (String Processing)
p17 (String Processing)
Concatenate S1 and S2
III. Extract the substring “low” from S1 IV. Find “are” in S2 and replace it with “is”*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
int choice;
while(1)
printf("5.exit\n");
scanf("%d", &choice);
switch (choice) {
case 1:
break;
case 2: {
char result[100];
strcpy(result, S1);
strcat(result, S2);
break;
}
case 3: {
char substring[4];
strncpy(substring, S1 + 1, 3);
substring[3] = '\0';
break;
case 4: {
if (found != NULL) {
} else {
break;
case 5:
exit(0);
default:
printf("Invalid choice\n");
break;
return 0;
}
OUTPUT