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



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

Answer / 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

More C Interview Questions

#include<stdio.h> void main() { int a=5,b=6,c; int x=(a<b)+7; int y=(x==7)*9; int z=(c=x+y)*2; printf("%h %h %h",x,y,z); } What is the output? Explain it.

8 Answers   IBM,


main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}

3 Answers  


If the static variable is declared as global, will it be same as extern?

1 Answers   Samsung,


What is derived datatype in c?

0 Answers  


int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?

6 Answers   TCS,






what is the height of tree if leaf node is at level 3. please explain

0 Answers  


#include<stdio.h> #include<conio.h> void main() { char ch='\356'; printf("%d",ch); } o/p=-18 why?plz.explain

2 Answers  


Diff between for loop and while loop?

2 Answers   TCS,


What are header files and explain what are its uses in c programming?

0 Answers  


Explain built-in function?

0 Answers  


c program to subtract between two numbers without using '-' sign and subtract function.

1 Answers  


what will be the output for the following program? main() { char ch = 'k'; char c; printf("%c",c); }

3 Answers  


Categories