Write a program to compare two strings without using the
strcmp() function
Answer Posted / sriramaraju
#include<stdio.h>
main()
{
//please read two strings int str1 and str2//
while(str1[i]!='/0' &&str2[i]!='/0')
if(str1[i]!=str2[i])
flag=1;
if(flag==1)
printf("equal");
}
| Is This Answer Correct ? | 127 Yes | 216 No |
Post New Answer View All Answers
What is a #include preprocessor?
Is printf a keyword?
What is sizeof return in c?
What is header file definition?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
How to write a multi-statement macro?
What is difference between union and structure in c?
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
why return type of main is not necessary in linux
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
What are two dimensional arrays alternatively called as?
What is build process in c?
Can we change the value of static variable in c?
What is a void pointer in c?
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.