Answer to Question #199234 in C for Pragadeesh

Question #199234

Read the four input string variables s1, s2, s3, s4 and store it in single string variable "COLLEGE" and display the string.


1
Expert's answer
2021-05-27T06:26:17-0400
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
    char s1[20],s2[20],s3[20],s4[20];
    printf("Enter first string : ");
    scanf("%s",s1);
    printf("Enter second string : ");
    scanf("%s",s2);
    printf("Enter third string : ");
    scanf("%s",s3);
    printf("Enter fourth string : ");
    scanf("%s",s4);
    strcat(s1,s2);
    strcat(s3,s4);
    strcat(s1,s3);
    char COLLEGE[strlen(s1)];
    strcat(COLLEGE,s1);
    printf("Concatenated String : %s",COLLEGE);
}

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