I was interview in company and I was asked a question, question was bit strange so wanted to ask with expert guys.
The question suppose I have function which returns bool type. Let us say this :
public bool func(int param)
{
bool retVal;
// here is some algorithm which as a result either set the retVal to false or true,
// It doesn't matter what is algo, the only thing important is it either do
// retVal=false or retVal=true
// The question is i have to write the algo here which in case
// if the previous algo gives us retVal=false then it should
// return true and if retVal=true then return false
}
What should be that algo ?