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 / sumant maurya

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[10];
char b[10];
int flag=0;
clrscr();
puts("enter the first string\n");
gets(a);
puts("enter the second string\n");
gets(b);
for(int i=0;i<=strlen(a);i++)
{
if(a[i]==b[i])
{
flag=1;
}
}
if(flag==1)
{
puts("matches");
}
else
{
puts("not matches");
}
getch();
}

Is This Answer Correct ?    6 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is spaghetti programming?

1199


What is the use of pragma in embedded c?

1098


Why c is called a middle level language?

1160


Explain what is operator promotion?

1147


Why is c called c?

1073


Can we use any name in place of argv and argc as command line arguments?

1125


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

1115


what is the significance of static storage class specifier?

2340


How do you list files in a directory?

1208


What are identifiers and keywords in c?

1196


How many identifiers are there in c?

1081


Is python a c language?

1054


How can I determine whether a machines byte order is big-endian or little-endian?

1124


What is 02d in c?

1111


What is #include called?

1101