Write a program to compare two strings without using the
strcmp() function
Answer Posted / belsia
void main()
{
char a[10],b[10];
int i=0;
scanf("%s%s",a,b);
if(strlen(a)!=strlen(b))
printf("they are different strings");
else
{
while(a[i]!='\0')
{
if(a[i]==b[i])
i++;
else
{
printf("They are different strings");
exit(0);
}
printf("Both are same");
}
getch();
}
| Is This Answer Correct ? | 27 Yes | 16 No |
Post New Answer View All Answers
Write programs for String Reversal & Palindrome check
Explain how do you list a file’s date and time?
Write a program to use switch statement.
How is a structure member accessed?
State the difference between realloc and free.
What is sizeof in c?
What is an array in c?
Distinguish between actual and formal arguments.
Explain how do you use a pointer to a function?
What is a lvalue
What is binary tree in c?
How many header files are in c?
can any one tel me wt is the question pattern for NIC exam
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
Is there a way to jump out of a function or functions?