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

What are header files? What are their uses?

1280


What are the advantages of external class?

1118


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

1155


Can you pass an entire structure to functions?

1172


What is an array in c?

1092


What is the value of h?

1083


What are the different file extensions involved when programming in C?

1340


Explain how do you determine the length of a string value that was stored in a variable?

1196


What is the purpose of type declarations?

1170


Linked list is a Linear or non linear explain if linear how it working as a non linear data structures

2230


What is the value of uninitialized variable in c?

1088


What is the use of header files?

1153


What is a shell structure examples?

1148


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

3165


What are the types of pointers in c?

1078