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 library is sizeof in c?
How can I swap two values without using a temporary?
What is advantage of pointer in c?
What is a stream water?
how to execute a program using if else condition and the output should enter number and the number is odd only...
How can a program be made to print the name of a source file where an error occurs?
Explain what is the benefit of using an enum rather than a #define constant?
What are the parts of c program?
What is bash c?
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
Are pointers integers in c?
code for replace tabs with equivalent number of blanks
What is the difference between the = symbol and == symbol?
praagnovation
How can you determine the maximum value that a numeric variable can hold?