now,I want to share an easy way about how to get the bits of a number quickly with you
#include<stdio.h>
#include<math.h>
void main()
{
int bits = 0;
int num;
printf("please input an integer number:");
scanf("%d",&num);
bits = log10(num)+1;
printf("The bits you inputed is : %d\n",bits);
}
. If you like the artical, please leave a message in the comments section!!!
Thank you for your watching.