Write a program to compare two strings without using the
strcmp() function

Answers were Sorted based on User's Feedback



Write a program to compare two strings without using the strcmp() function..

Answer / kedir

=> ALL ARE CORRECT ANSWER

Is This Answer Correct ?    26 Yes 49 No

Write a program to compare two strings without using the strcmp() function..

Answer / 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

More C Interview Questions

What is bubble sort in c?

0 Answers  


What are volatile variables in c?

0 Answers  


write a program to display all prime numbers

0 Answers  


how to devloped c lenguege?

4 Answers  


why you will give me a job in TCS.

7 Answers   TCS,






What is an anonymous union and where to apply that ?

3 Answers   HP,


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

0 Answers   Convergys,


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

0 Answers  


What is a memory leak? How to avoid it?

1 Answers  


Write a c program to demonstrate Type casting in c?

2 Answers  


What is the use of the function in c?

0 Answers  


What is main () in c?

0 Answers  


Categories