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 / belsia

void main()
{
char a[10],b[10];
int i=0;
scanf("%s%s",a,b);
if(strlen(a)!=strlen(b))
printf("they are different strings");
else
{
while(a[i]!='\0')
{
if(a[i]==b[i])
i++;
else
{
printf("They are different strings");
exit(0);
}
printf("Both are same");
}
getch();
}

Is This Answer Correct ?    27 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what do the 'c' and 'v' in argc and argv stand for?

1115


What is an array? What the different types of arrays in c?

1104


Can the curly brackets { } be used to enclose a single line of code?

1120


How does placing some code lines between the comment symbol help in debugging the code?

941


explain what is an endless loop?

1033


What are predefined functions in c?

1022


What is #define in c?

991


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2741


Write a program to reverse a string.

1025


write a program to generate address labels using structures?

4520


What are the types of variables in c?

979


How is = symbol different from == symbol in c programming?

984


What is meant by preprocessor in c?

948


write a program to display all prime numbers

1912


What is the size of enum in c?

1059