c – Float to binary conversion

I wrote a program to convert float to it’s binary IEEE754 representation in C.

Any improvements to this is appreciated

#include <stdio.h>
#include <stdlib.h>
void binary(float num) {
    int n = *(int *) &num; //Evil bit hack from Quake3 Q_sqrt function
    int size = sizeof(n) * 8; 
    char *s = malloc(1 + size); //A string which can hold 32 characters
    s(size) = '';
    int index = size - 1;
    while(index >= 0) {
        if (n & 1)
            *(s + index) = '1';
        else
            *(s + index) = '0';
        n >>= 1;
        index--;
    }
    printf("%sn", s);
    free(s);
}

int main(void) {
    float num;
    scanf("%f", &num);
    binary(num);
}