#include #define MAXLEN (1000+1) int charCount(char *, char); void commonChars(char *, char *); void ror(char *); void rol(char *); char *strCopy(char *, const char *); int isPrefix(const char *, const char *); char *substring(char *, const char *); int main() // main() of assignment 10 { char x[MAXLEN], c, y[MAXLEN], z[MAXLEN], *sP ; printf("Enter the 1st string:\n") ; scanf("%[^\n]", x) ; printf("Enter a character:\n") ; scanf(" %c", &c) ; printf("%d occurrence of %c in \"%s\"\n", charCount(x, c), c, x); printf("Enter the 2nd string:\n") ; scanf(" %[^\n]", y) ; printf("Common chars in \"%s\" and \"%s\" are: ", x, y); commonChars(x,y); putchar('\n'); ror(x); printf("Right-rotated: \"%s\"\n", x); rol(x); printf("Left-rotated: \"%s\"\n", x); sP = strCopy(z, x); printf("sP: \"%s\", z: \"%s\"\n", sP, z); if((sP = substring(x, y)) == NULL) printf("\"%s\" is not a substring of \"%s\"\n", y, x) ; else { printf("\"%s\" is a substring of \"%s\"", y, x) ; printf(" from index %d\n", (int)(sP-x)) ; } return 0; }