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
Explain what is wrong with this program statement? Void = 10;
Can true be a variable name in c?
What are keywords c?
What are header files why are they important?
What are valid signatures for the Main function?
how could explain about job profile
What is #include called?
shorting algorithmS
What is the collection of communication lines and routers called?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
If errno contains a nonzero number, is there an error?
What is the value of c?
What are types of functions?
How can I find the modification date and time of a file?
Does c have class?