Avaya Interview Question

their were 2 c++ programs to predict the o/p.