Consider |A| = a, |B| = b, then Number of relations from A to B is $2^{a \times b }$, as each element is A can map to every element is B, and each mapping may exist or not.
Now in case of a function its one - one or many to one. Hence total functions possible is $b^{a}$, as each value in A can map to only one value in B, and this is applicable 'a' times.
With this information in mind, number of functions from A to B in this case is $2^n$ But two of the functions are not onto i.e. the ones where all map to only 1st or 2nd element in B.
Hence answer is C