1. Engineering
  2. Computer Science
  3. write a while loop that prints usernum divided by 2...

Question: write a while loop that prints usernum divided by 2...

Question details

Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example output for userNum = 40:

20 10 5 2 1

#include <stdio.h>

int main(void) {
int userNum;

userNum = 40;

/* Your solution goes here */

printf("\n");

return 0;
}

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution