You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
538 B
C

/*
* C Program to Count the Number of Trailing Zeroes in Integer
*/
#include <stdio.h>
void main()
{
int j = 31, i, count = 0;
unsigned int num;
int b[32] = {0};
printf("enter the number:");
scanf("%d", &num);
while (num != 0)
{
if (num & 1 == 1)
{
break;
}
else
{
count++;
num = num >> 1;
}
}
printf("\n%d", count);
}