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 program to compare two strings without using the
strcmp() function

Answer Posted / raj

#include<stdio.h>
void main()
{
char name[80],name1[80];
int i;
printf("enter 1st string");
gets(name);
printf("enter 2st string");
gets(name1);
i=0;
while(name[i]==name1[i] && name1[i]!='\0')
i++;
if(name[i]==name1[i])
printf("two strings r equal\n");
else
printf("two strings r not equal\n");
}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are runtime error?

1140


What is signed and unsigned?

1068


How can I determine whether a machines byte order is big-endian or little-endian?

1067


What is a shell structure examples?

1109


How many identifiers are there in c?

1027


What is the difference between fread and fwrite function?

1092


In a switch statement, what will happen if a break statement is omitted?

1069


What are categories used for in c?

1103


What is the use of static variable in c?

1093


Describe static function with its usage?

1217


What is the advantage of using #define to declare a constant?

1100


Do pointers take up memory?

1165


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2266


Differentiate fundamental data types and derived data types in C.

1036


Explain what is the benefit of using const for declaring constants?

1040