C PROGRAM PLEASE
Write a program which declares a string and sets it to contain the phrase “Little butterflies listlessly fly among the lilies”. The string is first written to an output file and is then passed to a function called convert which converts each occurrence of “li” to “LI”. The main then writes the converted string to the output file, convert.txt. You program should consist of both the main and the function convert. The output file should look like: The original string is: Little butterflies listlessly fly among the lilies The string now is: Little butterfLIes LIstlessly fly among the LILIes
Expert Answer
#include<stdio.h>
#include<stdlib.h>
char *convert(char *str){
int i;
char *p = (char *)malloc(sizeof(char) * 100);
i = 0;
while (*(str + i) != ‘