Question: void printbinary(int number) { // Size of the integer is 32 bits for (int i = 31; i >= 0; i--) { int k =

void printbinary(int number) { // Size of the integer is 32 bits for (int i = 31; i >= 0; i--) { int k = number >> i; if (k & 1) printf("1"); else printf("0"); } } Can someone explain this c code? its suppose to take a decimal number and convert it to binary but comment the code so i can better understand what each line is doing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!