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

Can static variables be declared in a header file?

0 Answers  


What is nested structure in c?

0 Answers  


write a c program to find largest number in matrix(in each row,each column, diagonally, and in the whole matrix)? Its urgent.

2 Answers  


15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?

1 Answers  


write a program to display all prime numbers

0 Answers  


how do you programme Carrier Sense Multiple Access

0 Answers  


what are the advantages of a macro over a function?

0 Answers   TCS,


What are high level languages like C and FORTRAN also known as?

0 Answers  


write a program to create a sparse matrix using dynamic memory allocation.

0 Answers  


main() { int a=5; printf(?%d,%d,%d\n?,a,a< <2,a>>2); } Answer: 5,20,1 please explain this code in detail

6 Answers   TCS,


main() { int i=5; printf("%d%d%d%d",i++,i--,i); }

10 Answers  


What is wrong with this initialization?

0 Answers  


Categories