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");
*/

 

Your opinion matters
Please write your valuable feedback about DataFlair on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *