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                      
tip   SiteMap shows list of All Categories in this site.
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
There are 3 baskets of fruits with worng lables,one basket 
has apple,another basket has orange,another has combination 
of apple and orange,what is the least way of interchange 
the lables.
 Question Submitted By :: Yuva
I also faced this Question!!     Rank Answer Posted By  
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 1
First put the fruits to a suitable correct labled 
baskets . This is the easy way to Interchange the lables.
 
Is This Answer Correct ?    1 Yes 6 No
Mugeshprabhu P
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 2
   First we have 2 put all the apples and oranges in the
same basket.. Later v hav 2 arrange the fruits acc to the
lables in the basket..
 
Is This Answer Correct ?    1 Yes 7 No
Suganya
 
 
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 3
Lets Say Basket as B1, B2, B3 labelled Apple, Orange and 
Apple&Orange respectively.
As all the Baskets have wrong labels, we are sure for one 
thing that Basket B3 doesn't contain Apples&Orange So we 
will first take out the fruit from it. Suppose its Apple 
then surely B3 will get its real label i.e. Apple.
And as again we know that the all baskets were wrongly 
labelled... interchange the labels of basket B2 and B1.

So finally we have B1, B2 and B3 containing Orange, 
Apple&Orange and Apple respectively.

Therefore the least no of ways to find out the correct 
labels is ONE only.
 
Is This Answer Correct ?    8 Yes 2 No
Nitinbhatia2211
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 4
watch out for the fruits ,suppose the label on 1 is proper
we will be having 1 way but if the label and the content in
the basket totally miss match then we need min 2 ways
ANS;2
 
Is This Answer Correct ?    1 Yes 0 No
Rahul
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 5
i m agree with ans 3.
ans 3 is perfect..because all labels r incorrect initially.
 
Is This Answer Correct ?    1 Yes 0 No
Nagendra
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 6
one basket of apple,least possible way of interchange-1!
one basket of orange ,least possible way of interchange-1!
another has combination of apple nd orange,te least
 possible way of interchange-3C2
the least possible way of interchange-1C1+1C1+3C2=5
 
Is This Answer Correct ?    0 Yes 0 No
Ushnish Ranjan Chatterjee
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 7
suppose B1,B2,& B3 care the baskets.Now we will first open 
B1.suppose it contains Oranges.Then its level would be 
either Appale or Combination.Now suppose The lebel is 
combination.Now the basket with lebel orange is 
interchanged with it.As initially all baskets had wrong 
lebels.so the basket with lebel appale must have either 
orange or combination.so now we interchange the two lebels 
of the remaining baskets & get the proper answer.
 
Is This Answer Correct ?    0 Yes 1 No
Soumava Bose
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 8
Apples to apples
Oranges to oranges
combination to Apples and oranges
 
Is This Answer Correct ?    0 Yes 2 No
Guest
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 9
Beside answer 3, following is one more alternative:

Let the 3 baskets with labels A,O,M.  
Interchange labels of any 2 baskets. (assume that u 
interchanged lables of A & O)

Now see (or take out) the fruits of either of the baskets 
with changed labels (A & O).

There wud be 2 cases:
1. This basket(the one of which u saw (or took out) the 
fruits) has fruits not conforming to the label.
2. This basket(the one of which u saw (or took out) the 
fruits) has fruits conforming to the label.

If (1) is true,just interchange its label with the third 
untouched basket (basket with label M).

If (2) is true, just interchange label of other basket with 
the third untouched basket (basket with label M).

Idea is : Just one interchange of labels of any 2 basket 
will fix one basket with correct label. In second step you
 
Is This Answer Correct ?    1 Yes 0 No
Anoop
 
  Re: There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
Answer
# 10
continued ...

..In second step interchanging the left 2 baskets will fix 
all 3 with the right labels.
 
Is This Answer Correct ?    1 Yes 0 No
Anoop
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
for(i=1;i>0;i++); printf("i=%d",i); what will be the answer????  6
#include<stdio.h> int SumElement(int *,int); void main(void) { int x[10]; int i=10; for(;i;) { i--; *(x+i)=i; } printf("%d",SumElement(x,10)); } int SumElement(int array[],int size) { int i=0; float sum=0; for(;i<size;i++) sum+=array[i]; return sum; } output? Ramco5
how to create c progarm without void main()?  1
Software Interview Questions CAT1
Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.  1
Write a programme to find even numbers without using any conditional statement? Infosys3
write an algorithm to get a sentence and reverse it in the following format: input : I am here opuput: Here Am I note: first letter of every word is capiatlised  2
Write a C program that reads a series of strings and prints only those ending in "ed"  2
What is alloca() and why is its use discouraged?  1
Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h" Accenture14
how to add numbers without using arithmetic operators. TCS10
declare afunction pointer to int printf(char *)? HCL1
what is the difference between these initializations? Char a[]=”string”; Char *p=”literal”; Does *p++ increment p, or what it points to?  2
#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared like DCHAR ch1, ch2; TCHAR ch3, ch4; then what will be types of ch1, ch2, ch3 and ch4? NDS1
can we access one file to one directory?  1
5. What kind of sorting is this: SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort Accenture2
Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed. Scientific-Atlanta2
what is the first address that gets stored in stack according to a C or C++ compiler???? or what will be the first address that gets stored when we write a C source code???????? Apple2
write an interactive program to generate the divisors of a given integer. TCS4
plz answer.... write a program that reads line (using getline) e.g."345", converts each line to an integer using "atoi" and computes the average of all the numbers read. also compute the standard deviation.  1
 
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