#include<stdio.h> #include<string.h> int main() { char input[100]; int len = str
ID: 3747380 • Letter: #
Question
#include<stdio.h>
#include<string.h>
int main()
{
char input[100];
int len = strlen(input);
char output1[100];
char output2[] = "Copied string is - ";
printf("Enter your desired string of characters: ");
gets(input);
printf("The length of the string you entered is: %d ", len);
strcpy(output1,input);
printf("The copy of the string you entered is: %s ", output1);
strcat(output2, input);
printf("The Concatenated String is: %s ", output2);
return 0;
}
Explanation / Answer
#include<stdio.h>
#include<string.h>
int main()
{
char input[100];
int len = strlen(input);
char output1[100];
char output2[] = "Copied string is - ";
printf("Enter your desired string of characters: ");
scanf("%c", &len);
printf("The length of the string you entered is: %d ", len);
strcpy(output1,input);
printf("The copy of the string you entered is: %s ", output1);
strcat(output2, input);
printf("The Concatenated String is: %s ", output2);
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.