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

What are the 5 data types?

0 Answers  


What is nested structure in c?

0 Answers  


What is volatile variable in c with example?

0 Answers  


What is formal argument?

0 Answers  


can i know the source code for reversing a linked list with out using a temporary variable?

6 Answers   Honeywell,






what is the stackpointer

2 Answers  


Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.

2 Answers  


Can a program have two main functions?

0 Answers  


Meaning of () in c

1 Answers  


How the C program can be compiled?

11 Answers   HP,


what is the difference between structural,object based,object orientd programming languages?

1 Answers   PanTerra,


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

0 Answers  


Categories