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

write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1489


What is s or c?

598


define string ?

669


What is include directive in c?

646


What is context in c?

542






What is 2 d array in c?

559


Is c call by value?

607


what will be the output for the following main() { printf("hi" "hello"); }

9336


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1984


What are the complete rules for header file searching?

677


What are the two types of structure?

579


Should I learn data structures in c or python?

583


What is the best way to comment out a section of code that contains comments?

784


What are the functions to open and close file in c language?

730


What is #include in c?

600