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

Explain how can I prevent another program from modifying part of a file that I am modifying?

1094


What is the condition that is applied with ?: Operator?

1133


How pointer is different from array?

1087


What is the use of getch ()?

1077


How to implement a packet in C

2890


What is difference between union All statement and Union?

1113


Can a pointer be volatile in c?

992


What is difference between %d and %i in c?

1241


What do header files do?

1078


What is a macro?

1114


What is an identifier?

1036


write a program for the normal snake games find in most of the mobiles.

2260


please explain every phase in the "SDLC" in the dotnet.

2621


What is the difference between char array and char pointer?

1059


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

3265