Honeywell Interview Question

Solve an algorithm using whichever programming language ( C or C++ in this case)