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 / raghu ram. n

#include<stdio.h>
void main()
{ char string1[50], string2[50];
int i=0;
printf("Enter First String :");
gets(string1);
printf("Enter Second String :");
gets(string2);
while(string1[i]!=0&&string2[i]!=0&&srting1[i]==string2[i])
i++;
if(string1[i]=='\0'&&string2[i]=='\0')
printf("Two strings are equal");
else
printf("Two string are not equal");
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why return type of main is not necessary in linux

2043


Hai what is the different types of versions and their differences

1897


What does != Mean in c?

987


Can you tell me how to check whether a linked list is circular?

1325


List out few of the applications that make use of Multilinked Structures?

2110


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2136


How can this be legal c?

1044


Can we assign integer value to char in c?

1158


How can I swap two values without using a temporary?

1060


Is malloc memset faster than calloc?

1016


please send me the code for multiplying sparse matrix using c

2120


How can I change the size of the dynamically allocated array?

1093


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1070


What is a structural principle?

1090


List some applications of c programming language?

901