ques17.cpp - theoretical