Hi, I'm very new to c programming. I was tasked to create a c program where the user enters the number of digits and the binary number, and the output will the binary number separated by 3 spaces and the decimal equivalent of the binary number.

E.g

Input:

Enter the number of digits : 4

Enter the number in binaries : 1001

Output

1 0 0 1

The decimal equivalent is : 9

I tried using pow function but I didn't go far..