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 ?    10 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pointer in c plus plus?

1233


What is const volatile variable in c?

996


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

2017


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

2049


Can a pointer be volatile in c?

943


What is a double c?

944


Explain output of printf("Hello World"-'A'+'B'); ?

1444


What does s c mean on snapchat?

1050


Is anything faster than c?

973


Explain what are the different data types in c?

1173


Array is an lvalue or not?

1075


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

2394


How can I insert or delete a line (or record) in the middle of a file?

985


What do you mean by invalid pointer arithmetic?

1015


What is %d called in c?

1189