Design a C program to concatenate two messages and display of message and string length
Runtime Input :
string concatenate
Output :
stringconcatenate
17
#include <stdio.h>
#include <string.h>
int main()
{
char message1[100];
char message2[40];
printf("Enter meesage 1: ");
scanf("%s", message1);
printf("Enter meesage 2: ");
scanf("%s", message2);
strcat(message1, message2);
printf("\nConcatenate: %s\n", message1);
printf("\nString length: %d\n", strlen(message1));
}
Comments
Leave a comment