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

Define Array of pointers.

0 Answers  


how do you redirect stdout value from a program to a file?

1 Answers  


what does ‘#include’ mean?

1 Answers   TCS,


Why c is called a mid level programming language?

0 Answers  


suppose there are five integers write a program to find larger among them without using if- else

2 Answers  


what r the cpu registers r ther?

1 Answers  


What is hashing in c?

0 Answers  


program to get the remainder and quotant of given two numbers with out using % and / operators?

10 Answers   College School Exams Tests, IBM,


What is a pointer in c plus plus?

0 Answers  


i want to know the procedure of qualcomm for getting a job through offcampus

0 Answers   HCL,


write a program in c language for the multiplication of two matrices using pointers?

8 Answers   Ignou,


f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?

5 Answers   Geometric Software,


Categories