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


Please Help Members By Posting Answers For Below Questions

Can a local variable be volatile in c?

574


What is difference between class and structure?

570


What is the function of this pointer?

669


Why do we need a structure?

583


What is the difference between NULL and NUL?

724






What is modeling?

642


What is file in c preprocessor?

648


Differentiate between the expression “++a” and “a++”?

697


Can you assign a different address to an array tag?

696


c program to compute AREA under integral

1806


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

1737


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2051


What is the correct declaration of main?

675


What is a substring in c?

583


Explain how can I prevent another program from modifying part of a file that I am modifying?

633