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

Which of the following data structures is on average the fastest for retrieving data: 1) Binary Tree 2) Hash Table 3) Stack

3 Answers  


Write a program to identify if a given binary tree is balanced or not.

0 Answers   JPMorgan Chase,


#include<stdio.h> #include<conio.h> void main() { clrscr(); int a=0,b=0,c=0; printf("enter value of a,b"); scanf(" %d %d",a,b); c=a+b; printf("sum is %d",c); getch(); }

2 Answers  


State the difference between x3 and x[3].

0 Answers   Aricent,


In the following code segment what will be the result of the function, value of x , value of y { unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); } a) same, MAXINT, -1 b) not same, MAXINT, -MAXINT c) same , MAXUNIT, -1 d) same, MAXUNIT, MAXUNIT e) not same, MAXINT, MAXUNIT

1 Answers   IBM,






What is the advantage of an array over individual variables?

0 Answers  


What library is sizeof in c?

0 Answers  


Who invented bcpl language?

0 Answers  


#include<stdio.h> main(0 { printf("\n %d %d %d",sizeof(3),sizeof("3"),sizeof(3)); }

4 Answers   HCL,


Explain how do you list files in a directory?

0 Answers  


What does the format %10.2 mean when included in a printf statement?

0 Answers  


How macro execution is faster than function ?

0 Answers   Wipro,


Categories