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
Can an array be an Ivalue?
write a program to concatenation the string using switch case?
What is an lvalue in c?
What is unary operator?
Explain what is the benefit of using const for declaring constants?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
What is the use of pragma in embedded c?
Difference between pass by reference and pass by value?
What is the general form of function in c?
What is scanf () in c?
provide an example of the Group by clause, when would you use this clause
What is difference between union All statement and Union?
What is the use of volatile?
What are the types of variables in c?
What is the purpose of macro in C language?