Program to print binary equivalent of a given decimal integer
Below is the program in C Language that will take decimal number as input. It will then call a function that will calculate the binary equivalent of the input decimal number. #include #include int i = 0; int b[10]; void main() { int dec; int* DecimalToBinary(int n); int *p, j; printf(“Enter a decimal integer = “); scanf(“%d”, &dec); p = DecimalToBinary(dec); printf(“Binary of given decimal integer = “); for (j=i; j>=0; j–) printf(“%d”, p[j]); printf(“\n”); getch(); } int* DecimalToBinary(int n) { while (n != 1) { b[i] = n % 2; n = n / 2; i++; } if (n...