I am trying to assign null value to Boolean variable but it is not taking it
null
bool b = null;
You need to use a nullable bool:
bool? b = null;