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
Explain can the sizeof operator be used to tell the size of an array passed to a function?
Linked lists -- can you tell me how to check whether a linked list is circular?
What is scanf () in c?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
How can I avoid the abort, retry, fail messages?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
Can include files be nested?
What are logical errors and how does it differ from syntax errors?
Is it possible to have a function as a parameter in another function?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
What is a dynamic array in c?
What is the size of a union variable?
Describe the order of precedence with regards to operators in C.
What is the condition that is applied with ?: Operator?
Write a code on reverse string and its complexity.