ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
If we give two names then this displays the connection 
between the two people. It is nothing but flames game
 Question Submitted By :: Gita
I also faced this Question!!     Rank Answer Posted By  
 
  Re: If we give two names then this displays the connection between the two people. It is nothing but flames game
Answer
# 1
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
Gita
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is an object?  3
write a C code to reverse a string using a recursive function, without swapping or using an extra memory. Motorola2
what are two categories of clint-server application development ?  1
convert 12345 to 54321 withoutusing strig  3
how to find the binary of a number? Infosys5
let's take a code struct FAQ { int a; char b; float c; double d; int a[10]; }*temp; now explain me how the memory will be allocated for the structure FAQ and what address will be in the structure pointer (temp)....................  7
How to avoid structure padding in C? Tech-Mahindra4
How to set a variable in the environment list?  1
Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?  6
What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); } ADITI5
void swap(int a,int b) { a=a+b; b=a-b; a=a-b; } in this code always gives the same result for all case TCS7
Can you think of a way when a program crashed before reaching main? If yes how?  2
Difference between Class and Struct. Motorola6
how can i make a program with this kind of output.. Enter a number: 5 0 01 012 0123 01234 012345 01234 0123 012 01 0 Wipro3
Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;  7
how to find out the inorder successor of a node in a tree?? TCS2
design and implement a program that reads floating-points numbers in a sentinel-controlled loop until the user terminates the program by entering zero.your program should determinate and print the smallest,largest and average of the supplied numbers.  1
what is the difference between <stdio.h> and "stdio.h" Kanbay5
how to display 2-D array elements in spiral  1
difference between i++* and *++i IBM3
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com