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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
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
 
HOW TO ANSWER IF ASKED " WHAT KIND OF A PERSON ARE YOU?" I NEED AN ANSWER THAT IMPRESS THE INTERVIEWER  2
What is false about the following A compound statement is a.A set of simple statments b.Demarcated on either side by curly brackets c.Can be used in place of simple statement d.A C function is not a compound statement. TCS1
define function Assurgent4
How can I call a function, given its name as a string? ABC-Telecom2
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?  1
pgm to reverse string using arrays i.e god is love becomes love is god) (assumption:only space is used for seperation of words) no addtional memory used.i.e no temporary arrays can used. Persistent4
What is meant by int fun const(int a, int b) { .... ... }  1
How many types of linked lists what are they? How many types of data structures? BSNL5
How the C program can be compiled? HP7
How can draw a box in cprogram without using graphics.h header file & using only one printf(); ? NIIT1
How does C++ help with the tradeoff of safety vs. usability?  1
How to add two numbers without using arithmetic operators? Sapient11
what is the difference b/w compiler and debugger? Assurgent1
HOW TO HANDLE EXCEPTIONS IN C  5
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro? L&T4
void main() { int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} }; int (*p)[2]; int i,j,*pint; for(i=0;i<=3;i++) { p=&s[i]; pint=p; printf("\n"); for(j=0;j<=1;j++) printf("%d",*(pint+j)); } } while running this program it shows a warning-suspicious pointer conversion ie pint=p; my que is why should we assign the value of p to pint again.why cant we use it directly as *(p+j)..but if i use like tat the o/p is garbage value..  1
main() { printf(5+"Vidyarthi Computers"); }  6
2.main { int x,j,k; j=k=6;x=2; x=j*k; printf("%d", x); HCL6
How do we swap or interchange any 2 numbers without using Temporary variable...Anybody can pls answer it.. Thanks in Advance  7
the operator for exponencation is a.** b.^ c.% d.not available TCS4
 
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