Write a C program to concatenate two strings using standard library function.

C File =>

/* Write a C program to concatenate two strings using standard library function. */


#include<stdio.h>
#include<string.h>
int main() {
char s1[30],s2[30];
printf("\n Enter String1 : ");
scanf("%s",s1);
printf("\n Enter String2 : ");
scanf("%s",s2);
printf("\n Concatenated String : %s",strcat(s1,s2));
return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.