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

How does selection sort work in c?

1023


Where are some collections of useful code fragments and examples?

1147


How arrays can be passed to a user defined function

1008


How to establish connection with oracle database software from c language?

2182


What is output redirection?

1205


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

1165


What is actual argument?

1051


Difference between macros and inline functions? Can a function be forced as inline?

1249


in linking some of os executables are linking name some of them

2111


Do you know what are the properties of union in c?

1064


What is double pointer?

986


how to introdu5ce my self in serco

1989


What is volatile keyword in c?

1026


Why is extern used in c?

1085


Explain high-order and low-order bytes.

1086