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 the meaning of 2d in c?
Is void a keyword in c?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
How can a program be made to print the line number where an error occurs?
Explain heap and queue.
What is nested structure?
What are Macros? What are its advantages and disadvantages?
int i=10; printf("%d %d %d", i, i=20, i);
What does == mean in texting?
What is a char in c?
Why clrscr is used after variable declaration?
Can we compile a program without main() function?
What does c mean?
What do you mean by keywords in c?
Explain how do you view the path?