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

wap in c to accept a number display the total count of digit

4 Answers  


if a five digit number is input through the keyboard, write a program to calculate the sum of its digits. (hint:-use the modulus operator.'%')

23 Answers  


What is #error and use of it?

0 Answers  


What's the best way of making my program efficient?

0 Answers   Celstream,


class foo { public: static int func(const char*& p) const; }; This is illegal, why?

8 Answers   Google,






Why static variable is used in c?

0 Answers  


Write a program to find minimum between three no.s whithout using comparison operator.

4 Answers   IBM,


What is difference between Structure and Unions?

0 Answers   TISL,


who is the editor of 'pokemon'?

1 Answers  


can we print any string without using terminator?

2 Answers   Infosys, TCS,


Which is the memory area not included in C program? give the reason

0 Answers   IBM, TCS,


char ch="{'H','I',0};printf("%s",ch);what is output

9 Answers   Accenture,


Categories