Find Index of least significant bit set in an Integer. ex.
int value is say 10001000 results should be 4.
Answer / 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 |
Where we use clrscr in c?
what is the function of .h in #include<stdio.h> in c ?
23 Answers HCL, IBM, Wipro,
Why do we need functions in c?
What is operator promotion?
How to convert decimal to binary in C using recursion??
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
How a string is stored in c?
What is main () in c language?
Write a program to print fibonacci series without using recursion?
What are the loops in c?
Differentiate between new and malloc(), delete and free() ?
How can I prevent another program from modifying part of a file that I am modifying?