C PRACTICAL / COMPARE TWO GIVEN STRING(CASE SENSITIVE AND CASE INSENSITIVE)

hello friends....

TAKE THE FIRST STEP TO KNOWLEDGE FRIENDS BECAUSE KNOWLEDGE IS FREE.

>> /* WRITE A C PROGRAM TO COMPARE TWO GIVEN STRING(CASE SENSITIVE AND CASE INSENSITIVE). */

#include<stdio.h>
#include<conio.h>
void main()
{
   char str1[30],str2[30];
   int l;
   clrscr();

   printf("enter string-1 : ");
   gets(str1);
   printf("enter string-2 : ");
   gets(str2);

   l = strcmp(str1,str2);

   if(l==0)
      printf("string is equal \n");
   else
      printf("string is NOT equal \n");

   getch();
}

   /*  OUTPUT  */
======================

enter string-1 : string
enter string-2 : STRING
string is NOT equal

* * * * * * * * * * * * * *
http://www.dnpdeveloper.com

if you have like this blog so share and subscribe, comment for this blog.
if your any question, so comment pleass.
MY INSTAGRAM ID : dnp176

Comments