#include <stdio.h>
int main(){
int x,arr[16],i=0;
printf("Enter the integer value: ");
scanf("%d",&x);
while(x > 0){
arr[i]= x % 2;
x = x/2;
i++;
}
for(i=i-1; i>=0; i--){
printf("%d ",arr[i]);
}
return 0;
}
#include <stdio.h>
int main(){
int x,arr[16],i=0;
printf("Enter the integer value: ");
scanf("%d",&x);
while(x > 0){
arr[i]= x % 2;
x = x/2;
i++;
}
for(i=i-1; i>=0; i--){
printf("%d ",arr[i]);
}
return 0;
}