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 pointers in c with example?

1025


What is the difference between struct and union in C?

1246


How do we print only part of a string in c?

976


What does typeof return in c?

1022


What is the difference between array and linked list in c?

1088


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2404


When should we use pointers in a c program?

1083


What is pass by value in c?

1009


Should a function contain a return statement if it does not return a value?

1024


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1056


Explain what does a function declared as pascal do differently?

1216


Are there constructors in c?

973


please send me the code for multiplying sparse matrix using c

2122


List the difference between a 'copy constructor' and a 'assignment operator' in C?

1036


How can you draw circles in C?

1100