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
Get step-by-step solutions from verified subject matter experts
