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
What are the differences between Structures and Arrays?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What is the difference between declaring a variable by constant keyword and #define ing that variable?
What is the default value of local and global variables in c?
Write a program which returns the first non repetitive character in the string?
When should structures be passed by values or by references?
What is meant by inheritance?
Explain about C function prototype?
Is c high or low level?
How can I delete a file?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What is the full form of getch?
Why array is used in c?
What is the difference between text and binary i/o?
How can you find out how much memory is available?