Posts by Breno Souza • 3 points
1 post
-
0
votes1
answer69
viewsQ: Segmentation failure (recorded core image) decimal to binary conversion
#include <stdio.h> int main() { int d; int bits = 8; int vetor[bits]; int a = bits - 1; int b = a; scanf("%d", &d); if(d >= 2) { while(d/2 > 0){ vetor[a] = b % 2; b /= 2; a--; b--; }…