Write a program to compare two strings without using the
strcmp() function
Answer Posted / raj
#include<stdio.h>
void main()
{
char name[80],name1[80];
int i;
printf("enter 1st string");
gets(name);
printf("enter 2st string");
gets(name1);
i=0;
while(name[i]==name1[i] && name1[i]!='\0')
i++;
if(name[i]==name1[i])
printf("two strings r equal\n");
else
printf("two strings r not equal\n");
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
By using C language input a date into it and if it is right?
How many levels of pointers have?
a program that can input number of records and can view it again the record
Explain main function in c?
In which layer of the network datastructure format change is done
How do you list a file’s date and time?
What type of function is main ()?
What are c identifiers?
How to draw the flowchart for structure programs?
What is d scanf?
How can a number be converted to a string?
What is volatile keyword in c?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
What is the heap?
When c language was developed?