Compute the binary equivalent of n/2. Append 0 to it if n is even; append 1 to it if n is odd.Use the following header for the function:
string binaryEquivalent(int n);To append a "0" or a "1" to a string, you should use the string concatenate operation "+".