#include <stdio.h>

int main() {
    int a;
    scanf("%d", &a);
    int b = a / 2;
    int r = a % 2;
    int i = 0;
    int arr[101] = {};
    arr[i] = r;

    while (b != 0) {
        i++;
        a = b;
        b = a / 2;
        r = a % 2;
        arr[i] = r;
    }
    for (; i >= 0; i--) {
        printf("%d", arr[i]);
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: