Thanks for the question, Rahul.
But personally I find the explanation somewhat confusing, specifically the last paragraph where it reads:
It is '*' because when we convert character or binary expressions to an expression of a different data type, data can be truncated, only partially displayed, or an error is returned because the result is too short to display. * means the result length too short to display
In regards to the default length when n is undefined, it doesn't make a difference whether you use CAST or CONVERT.
@length1 prints 1 because no conversion is carried out (varchar = varchar).
@length2 prints * because the result (30, due to the conversion from varchar to char) actually is too long
to fit into a column implicitely set to varchar(1) = by not specifying the length in the variable declarartion.