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

By using C language input a date into it and if it is right?

1042


How many levels of pointers have?

1010


a program that can input number of records and can view it again the record

1875


Explain main function in c?

1054


In which layer of the network datastructure format change is done

1844


How do you list a file’s date and time?

1037


What type of function is main ()?

1009


What are c identifiers?

1054


How to draw the flowchart for structure programs?

9284


What is d scanf?

1031


How can a number be converted to a string?

1271


What is volatile keyword in c?

1009


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3639


What is the heap?

1170


When c language was developed?

1020