Three persons X,Y and Z would like to know their average salaries without disclosing their own salaries. How can they do it?

Well it’s easy but you have to do some mathematics for it.

let the salary of person be denoted by XS,YS and ZS.
let person X writes a number that includes her salary and a random number say r1. so the random number is (XS+r1). Now Y adds a number to it which includes her salary and a random number(YS+r2). Z does the same thing with ZS and r3. Now X removes his random number r1 from the total. After X Y and Z does the same thing to the sum. After Z has subtracted her random number the total is the sum of the salaries of X,Y and Z. So the average will be the number divided by 3.