#include <stdio.h>

int a[6], b, c, i;

int main() {
    for(i=0; i<6; i++) {
        scanf("%d", &a[i]);
    }
    printf("numero binario = ");
    for(i=0; i<6; i++) {
        printf("%d", a[i]);
    }
    printf("---->");
    c=1; b=0;
    for(i=5; i>=0; i--) {
        b=b+a[i]*c;
        c=c*2;
    }
    printf("numero decimale = %d", b);
}

Embed on website

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