Issue in getting expected randomized value

In reply to Sushrut Veerapur:

Thanks.

Can we have nested if inside constraint?

If i have that it is not giving any compilation issue but iam not getting the expected output.