Answer Posted / karthikeyan n p
#include<stdio.h>
#include<conio.h>
void main()
{
char st1[10],st2[10];
int i,sl1=0,sl2;
clrscr();
printf("\nEnter String1:");
scanf("%s",st1);
printf("\nEnter String2:");
scanf("%s",st2);
for(i=0;st1[i]!='\0';i++)
sl1=sl1+1;
for(i=0;st2[i]='\0';i++)
sl2=sl2+1;
if(sl1!=sl2)
{
printf("\nString is not equal.");
}
else
{
for(i=0;st1[i]!='\0' || st2[i]!='\0';i++)
{
if(st1[i]!=st2[i])
{ f=1; }
}
if(f==1)
printf("\nString is not equal.");
else
printf("\nString is equal.");
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 5 No |
Post New Answer View All Answers
What is pointers in c with example?
develop algorithms to add polynomials (i) in one variable
What is modeling?
How can I insert or delete a line (or record) in the middle of a file?
What is pivot in c?
Why is this loop always executing once?
What does %d do?
How can a number be converted to a string?
I came across some code that puts a (void) cast before each call to printf. Why?
Compare array data type to pointer data type
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What is the scope of local variable in c?
Subtract Two Number Without Using Subtraction Operator
What is c programming structure?
When should the register modifier be used? Does it really help?