#include <stdio.h>
int main() {
int num, count = 0;
printf("Enter an integer: ");
scanf("%d", &num);
if (num <= 0) {
printf("Please enter a positive integer.\n");
} else {
while (num > 1) {
if (num % 2 == 0) {
num /= 2;
count++;
} else {
break;
}
}
printf("The number can be divided by 2 %d times until it becomes 1.\n", count);
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: