diff --git a/C/dec_to_bin.c b/C/dec_to_bin.c new file mode 100644 index 0000000..7abcb67 --- /dev/null +++ b/C/dec_to_bin.c @@ -0,0 +1,19 @@ +#include +#include +int main() +{ +int arr[1000],n,i; +printf("Enter the decimal number:\n"); +scanf("%d",&n); +for(i=0;n>0;i++) +{ +arr[i]=n%2; +n=n/2; +} +printf("\nBinary equivalent of the given number is= "); +for(i=i-1;i>=0;i--) +{ +printf("%d",arr[i]); +} +return 0; +} \ No newline at end of file