Prodapt Solutions Interview Question

Logical questions and basics in C and C++. In coding round, a question from graph came.