#include #include extern char* sub_string(char*, int, int); int main(int argc, char** argv) { char* in_string = malloc(sizeof(char) * 128); printf("Enter a string: "); scanf("%s", in_string); int start = -1; printf("Enter the start index: "); scanf("%d", &start); int end = -1; printf("Enter the end index: "); scanf("%d", &end); char* out_string; out_string = sub_string(in_string, start, end); printf("The substring of the given string is '%s'\n", out_string); return 0; }