Magma (IL) interview question

2 question about coin flip, some cpp