Compare two strings

#include <stdio.h>
#include <string.h>

int main()
{
   char a[100], b[100];

   printf("Enter a string\n");
   gets(a);

   printf("Enter a string\n");
   gets(b);

   if (strcmp(a,b) == 0)
      printf("The strings are equal in length\n");
   else
      printf("The strings are not equal \n");

   return 0;
}



OUTPUT : -




For Other Programs Visit The WebSite:-   https://www.techapurba.com/

Follow Me On Social Media :-

For tech related videos visit my other website :- https://apurbatechinfo.blogspot.com/

Post a Comment

0 Comments