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

#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<conio.h>
void main()
{
clrscr();
char a[100],b[100];
int i,m;
cout<<"enter first string";
gets(a);
cout<<"enter second string";
gets(b);
for(i=0;a[i]!='\0'&&b[i]!='\0';i++)
{
if(a[i]!=b[i])
{
c=1;
}
}
if(c==1)
{cout<<"the strings do not match!";
}
else
{
cout<<"the strings match!";
}
getch();
}

Is This Answer Correct ?    7 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is a static function?

1050


What is the advantage of an array over individual variables?

1190


Is fortran faster than c?

987


What is wild pointer in c?

1019


Give differences between - new and malloc() , delete and free() ?

1048


What are identifiers c?

1023


How can I read/write structures from/to data files?

925


What is the difference between memcpy and memmove?

968


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1199


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1273


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1188


What are compound statements?

1087


What is void pointers in c?

960


Define circular linked list.

978


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

2163