Question: how would i convert this for loop C code to a while loop? void printbinary(const int number) // const makes sure number won't change inside
how would i convert this for loop C code to a while loop?
void printbinary(const int number) // const makes sure number won't change inside the function. { for (int i = 31; i >= 0; i--) { int a = number >> i; if (a & 1) printf("1"); else printf("0"); } //system("PAUSE"); return; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
