write a own function to compare two strings with out using
stringcomparition function?
Answer Posted / mallesh
#include<stdio.h>
#include<conio.h>
int xstrcmp(char*,char*);
void main()
{
int c;
char a1[20],a2[20];
printf("Enter the two string's :\n");
gets(a1);
gets(a2);
c=xstrcmp(&a1[0],&a2[0]);
printf("%d",c);
getch();
}
int xstrcmp(char *a,char *a1)
{
while((*a)==(*a1))
{
if((*a=='\0')||(*a1=='\0'))
break;
++(a);
++(a1);
}
return((*a)-(*a1));
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
what is the diffrenet bettwen HTTP and internet protocol
How can you determine the maximum value that a numeric variable can hold?
Is it acceptable to declare/define a variable in a c header?
What functions are in conio h?
What is variable in c example?
What does c mean before a date?
How do you print an address?
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.
How can you read a directory in a C program?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
What is formal argument?
Tell me what is the purpose of 'register' keyword in c language?
What is indirection?
How many keywords are there in c?
What is ponter?