write a own function to compare two strings with out using
stringcomparition function?
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
int xstrcmp(char*,char*);
void main()
{
int c;
char a1[20],a2[20];
printf("enter the two strings :");
gets(a1);
gets(a2);
c=xstrcmp(&a1[0],&a2[0]);
printf("%d",c);
getch();
}
int xstrcmp(char *a,char *a1)
{
if((*a)!=(*a1))
return((*a)-(*a1));
else if((*a)!='\0' && (*a1)!='\0')
{
(*a)++;
(*a1)++;
xstrcmp(a,a1);
}
else
return 0;
}
| Is This Answer Correct ? | 5 Yes | 6 No |
Post New Answer View All Answers
Explain the priority queues?
How can I write a function analogous to scanf?
I have seen function declarations that look like this
what do u mean by Direct access files? then can u explain about Direct Access Files?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
How can I make it pause before closing the program output window?
Hai what is the different types of versions and their differences
What are the functions to open and close file in c language?
How many header files are in c?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
Is it possible to have a function as a parameter in another function?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
Where is volatile variable stored?
how many key words availabel in c a) 28 b) 31 c) 32