Believe it or not ! .. There's actually a program in C which solves this problem using recursion.

Coding this is considered to be super elite !!