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 / anil sai krishna

#include<stdio.h>
main()
{
char a[15],b[15];
int i,l=0,m;
printf("enter the two strings");
scanf("%s%s",a,b);
for(i=0;a[i]=b[i];i++)
{
l++;
}
for(i=0;a[i]!='\0';i++)
{
m++;
}
if(l==m)
{
printf("strings are equal");
}
else
{
printf("not equal");
}
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c weakly typed?

974


In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.

1810


Why c is a mother language?

984


Explain the difference between getch() and getche() in c?

949


Differentiate between declaring a variable and defining a variable?

1003


What is volatile, register definition in C

1069


Why is c called a structured programming language?

1230


How to declare a variable?

969


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2090


What is difference between static and global variable in c?

1000


What is a node in c?

934


What is the use of function in c?

1157


What is the difference between formatted&unformatted i/o functions?

1016


Difference between Shallow copy and Deep copy?

1978


What are control structures? What are the different types?

1049