#include <stdio.h>

int main() {
    int number;
    int count = 0;

    printf("Enter an integer: ");
    scanf("%d", &number);


    if (number <= 0) {
        printf("Please enter a positive integer.\n");
        return 1; 
    }

    while (number > 1) {
        number /= 2;
        count++;
    }

    printf("The number can be divided by 2 %d times until it becomes 1.\n", count);

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: