#include <stdio.h>
#include <stdlib.h>
void dec2bin(char operadores[], int numero, int qtdadeBits) {
for (int i = qtdadeBits - 1; i >= 0; i--) {
int deslocamento = numero >> i;
operadores[qtdadeBits - 1 - i] = deslocamento & 1 ? '1' : '0';
}
}
int main() {
char operadores[200] = { 0 };
dec2bin(operadores, 10, 5);
}
//https://pt.stackoverflow.com/q/197558/101
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4gICAgCgp2b2lkIGRlYzJiaW4oY2hhciBvcGVyYWRvcmVzW10sIGludCBudW1lcm8sIGludCBxdGRhZGVCaXRzKSB7Cglmb3IgKGludCBpID0gcXRkYWRlQml0cyAtIDE7IGkgPj0gMDsgaS0tKSB7CgkJaW50IGRlc2xvY2FtZW50byA9IG51bWVybyA+PiBpOwoJICAgIG9wZXJhZG9yZXNbcXRkYWRlQml0cyAtIDEgLSBpXSA9IGRlc2xvY2FtZW50byAmIDEgPyAnMScgOiAnMCc7Cgl9Cn0KCmludCBtYWluKCkgewogICAgY2hhciBvcGVyYWRvcmVzWzIwMF0gPSB7IDAgfTsKICAgIGRlYzJiaW4ob3BlcmFkb3JlcywgMTAsIDUpOwogICAgcHJpbnRmKCIlcyIsIG9wZXJhZG9yZXMpOwp9CgovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8xOTc1NTgvMTAx