CUDA Unified Memory : C Example

One of the brand new features introduced by NVIDIA in CUDA 6.0 is Unified Memory. Helping the programmer to reduce the amount of code written, and simplify the code. The Unified Memory helps managing memory, and maximizing data access speed transparently between the CPU and GPU. This is a simple C example, on how to use unified memory, following a question I have seen on different forums.