int n;
int i,k;
int tmp,m; //Five integer variables are defined
printf ("Please enter a decimal number:\n");
scanf("%d",&n); //Read an input variable
printf("2 ");//Output 2
for(i=30,k=n;i>=0;i--) //Loop 30 times and assign the initial value to K as the input N p>
{
tmp=int(pow(2,i)); //tem =2 raised to the i power
m=k/tmp; //m =K divided by tem
printf("%d",m); //Output M
k=k-m*tmp; //Reassign K
< p> }printf("\n4 ");
Each loop below is similar