Answer to Question #304328 in C for harikarthick

Question #304328

Design a C program to concatenate two messages and display of message and string length


Runtime Input :


string concatenate


Output :


stringconcatenate


17

1
Expert's answer
2022-03-01T07:12:41-0500
#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));    
    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS