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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started