Question: Make a C program which reads two strings from standard input and concatenates them and output the result by filling the skeleton code. The strings

Make a C program which reads two strings from standard input and concatenates them and output the result by filling the skeleton code.

The strings are input for each lines and the length of the strings is less than 128.

NOTE: Do NOT use functions defined in string.h

____________________________________________________________________

#include

#define MAX_STR 128

void str_concatenate(char* str1, char* str2, char* result) { // Fill this function }

int main(int argc, char** argv) { char str1[MAX_STR]; char str2[MAX_STR]; char result[2 * MAX_STR];

// read two strings scanf("%s %s", str1, str2);

// concatenate strings using str_concatenate function str_concatenate(str1, str2, result);

// output concatenated string printf("%s ", result);

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!