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

#include<stdio.h>
void main()
{
char name[80],name1[80];
int i;
printf("enter 1st string");
gets(name);
printf("enter 2st string");
gets(name1);
i=0;
while(name[i]==name1[i] && name1[i]!='\0')
i++;
if(name[i]==name1[i])
printf("two strings r equal\n");
else
printf("two strings r not equal\n");
}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is a pointer variable declared?

1158


What is the acronym for ansi?

1105


int far *near * p; means

3621


What's the total generic pointer type?

1104


What is the concatenation operator?

1205


What is variables in c?

1094


What is wild pointer in c?

1124


develop algorithms to add polynomials (i) in one variable

2235


List the difference between a "copy constructor" and a "assignment operator"?

1064


What is structure packing in c?

1138


What is string length in c?

1158


How can I call a function with an argument list built up at run time?

1285


How many types of arrays are there in c?

1083


Explain how to reverse singly link list.

1202


What is meant by errors and debugging?

1153