In case of Logistic Regression Regression is it mandatory to have

a) the independent & target variable as categorical(Yes/No, 1/0)

or,

b) independent variable as continuous & target to be categorical(Yes/No, 1/0)

What is the right procedure mentioned above? And what about the linear regression independent variable?