Find Index of least significant bit set in an Integer. ex.
int value is say 10001000 results should be 4.
Answer Posted / supri
I think the following code will help!!!!!!
#include<stdio.h>
main()
{
int a,count=0;
scnaf("%d",&a);
while(a)
{
if(a&1==1)
{
printf("%d",++count);
break;
}
a=a>>1;
++Count;
}
return;
}
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is structure of c program?
What is %d called in c?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
write a program to concatenation the string using switch case?
Explain threaded binary trees?
What is a newline escape sequence?
Explain what does a function declared as pascal do differently?
What is the use of getchar() function?
Why does notstrcat(string, "!");Work?
What is calloc in c?
How can I manipulate strings of multibyte characters?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
code for replace tabs with equivalent number of blanks
How is a null pointer different from a dangling pointer?
What is the main difference between calloc () and malloc ()?