Issue in getting expected randomized value

In reply to bharath123:

Please publish your complete code.