Tuesday, 9 January 2018

Learn C language Part 32 Compare String Program {Checking two input str...



#include <stdio.h>

#include <conio.h>



main()

{

char c[50];

char d[50];

int i=0,flag=0;

printf("Enter the 1st String : ");

gets(c);



printf("\nEnter the 2nd String : ");

gets(d);





while(c[i]!='\0')

{



if(c[i]!=d[i])

{

flag=1;

break;

}

i++;

}



if(flag==0)

{

printf("both strings are equal!");

}

else

{

printf("both strings are not equal!");



}

}

No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...