Sunday, 1 May 2011

Salary

Question: 4 persons are sitting in dinner table taking lunch .They are working in the same company.They do not know the salary of each other.They can not disclose the salary.
what is the way to know the salary of each person?....
-------------------------------------------------------------------------------------------------------
Answer:
A , B , C,D are 4 person
A gives a random number to B=a1
B gives a random number to C=b1
C gives a random number to D=c1
D gives a random number to A=d1
Since A knows his salary i.e. a
so
 A will know B's Salary by= a+d1-a1;
similarly

Since B knows his salary i.e. b
so B will know C's Salary by= b+a1-b1;
Since C knows his salary i.e. c
so C will know D's Salary by= c+b1-c1;
Since D knows his salary i.e. d
so D will know A's Salary by= d+c1-d1;


No comments:

Post a Comment