Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a own function to compare two strings with out using
stringcomparition function?

Answer Posted / sasikumar

main()
{
char s1[10],s2[10];
printf("enter two strings:");
scanf("%s%s",&s1[10],&s2[10]);
compare(s1[10],s2[10]);
getch();
}
compare(char st1[10],char st2[10])
{
int l1,l2,i;
l1=strlen(st1[10]);
l2=strlen(str2[10]);

if(l1==l2)
{
for(i=0;i<l1;i++)
{
if(st1[i]==st2[i])
{
if(i==l1)
{
printf("two strings are equal");
}

}
else
goto label:
}
}
else
goto label:
label:printf("not equal");
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why cant I open a file by its explicit path?

989


Is Exception handling possible in c language?

1991


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

6189


What's a good way to check for "close enough" floating-point equality?

1095


What are the types of data files?

1149


Can we declare variable anywhere in c?

921


Explain how do you determine the length of a string value that was stored in a variable?

1094


What does the characters “r” and “w” mean when writing programs that will make use of files?

1423


What are volatile variables in c?

889


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3285


What is the purpose of type declarations?

1077


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

1054


how many errors in c explain deply

2036


What are the advantages and disadvantages of c language?

962


What is a structural principle?

1090