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 you please explain the difference between malloc() and calloc() function?

631


What is the use of getch ()?

648


The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.

1078


Explain the concept and use of type void.

639


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

1607






Describe the modifier in c?

612


What is the meaning of c in c language?

608


What are different types of variables in c?

579


What is structure in c definition?

583


What does return 1 means in c?

593


How can you restore a redirected standard stream?

621


What is the difference between array and pointer in c?

594


What are the modifiers available in c programming language?

753


Explain what are the __date__ and __time__ preprocessor commands?

601


A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

1752