#include int DecToBin(); int main() { int rc=0; rc = DecToBin(); return rc; } int DecToBin() { int decimal; /* number to be input from user */ int result; /* result of dividing by power of 2 */ printf("Please input a number between 0 and 1024 \n"); scanf("%d",&decimal); if (decimal<0 || decimal > 1024) { printf("%d is an invalid input. Exiting. \n",decimal); return -1; } result = decimal / 1024; if (result == 0) { printf("0"); } else { printf("1"); decimal = decimal - 1024; } printf("\n"); return 0; }