Initially I thought there is a typo in this line
if (a = cos(pi * i/2))
Then I checked the ISRO paper and found that it is correct i.e. @makhdoom has not done any mistake.
According to that,
i = 0 : Cos(0), i.e. a = 1 i.e. condition will be True, hence it will print 1.
i = 1 : Cos(Pi/2) i.e. a = 0 i.e. Condition will be False, Hence It will print 0.
i = 2 : Cos(Pi) i.e. a = -1, i.e. Condition will be True, Hence It will print 1.
Hence answer is C. 101