If we give two names then this displays the connection
between the two people. It is nothing but flames game

Answer Posted / gita

main()
{
char name1[20],name2[20];
int a,b,i,j,c;
clrscr();
printf("Enter the first name:\t");
gets(name1);
printf("Enter the second name:\t");
gets(name2);
a=strlen(name1);
b=strlen(name2);

for(i=0;i<=a;i++)
{
for(j=0;j<=b;j++)
{
if(name1[i]==name2[j])
{
a--;
b--;
}
}
}
c=a+b;
i=c%6;
switch(i)
{
case 0:printf("Friends");
break;
case 1:printf("lovers");
break;
case 2:printf("Ansisters");
break;
case 3:printf("marriage");
break;
case 4:printf("enemies");
break;
case5:printf("sisters");
break;
}

getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is array a primitive data type in c?

566


can any one provide me the notes of data structure for ignou cs-62 paper

1692


What are data types in c language?

578


Explain is it better to bitshift a value than to multiply by 2?

701


What is hashing in c language?

603






When can you use a pointer with a function?

555


What is array of pointers to string?

555


What is malloc and calloc?

558


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1483


how can use subset in c program and give more example

1488


What is c variable?

540


What is the advantage of c?

604


Explain what is the benefit of using an enum rather than a #define constant?

706


What does double pointer mean in c?

566


Which header file is used for clrscr?

565