C Program For String Functions
Get Certified in C Programming and Take Your Skills to the Next Level
Program 1
// Functions of string in c Programming
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
char s1[100], s2[100],s3[100];
int x;
printf("Enter First string: ");
gets(s1);
printf("Enter First string: ");
gets(s2);
puts(s1);
puts(s2);
strcpy(s3,s1);
strcat(s3,s2);
printf("After Concate %s",s3);
return 0;
}
/*
x=strlen(s);
printf("Length of string is %d",x);
strcpy(s1,s);
printf("\nReverse is %s ",strrev(s1));
printf("\nold string is %s ",s);
x=strcmpi(s1,s2);
if(x==0)
printf("Strings are same");
else
printf("Strings are not same");
*/
Did you like this article? If Yes, please give DataFlair 5 Stars on Google

