
How to convert decimal numbers into binary digits without using pow function in c language?

#include<stdio.h>
#include<conio.h>
void main(){
int binary[20];
int i=0,number;
printf("Enter the number :");
scanf("%d",&number);
while(number!=1){
binary[i]=number%2;
i++;
number=number/2;
}
binary[i]=number;
for(;i>=0;i--)
printf("%d",binary[i]);
getch();
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.