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
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
How can I sort a linked list?
What is difference between function overloading and operator overloading?
What is huge pointer in c?
What is the use of a static variable in c?
Why can’t constant values be used to define an array’s initial size?
Why c language is called c?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
Can we declare function inside main?
Why can’t we compare structures?
What is an expression?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Is this program statement valid? INT = 10.50;
What is a volatile keyword in c?
largest Of three Number using without if condition?