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
Is array a primitive data type in c?
can any one provide me the notes of data structure for ignou cs-62 paper
What are data types in c language?
Explain is it better to bitshift a value than to multiply by 2?
What is hashing in c language?
When can you use a pointer with a function?
What is array of pointers to string?
What is malloc and calloc?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
how can use subset in c program and give more example
What is c variable?
What is the advantage of c?
Explain what is the benefit of using an enum rather than a #define constant?
What does double pointer mean in c?
Which header file is used for clrscr?