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 |
what is the use of c program?
4 Answers Synergy, Web Synergies,
Why do u use # before include in a C Progam?
write a c program to accept a given integer value and print its value in words
4 Answers Vernalis, Vernalis Systems,
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
what is uses of .net
Is c easy to learn?
what is the difference between getch() and getchar()?
What are different types of operators?
Define a structure to store roll no, name and marks of a student. Using the structure of above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user.
void main() { int a[]={1,2,3,4,5},i; for(i=0;i<5;i++) printf("%d",a++); getch(); }
Write a program to reverse a given number in c?
What are the various topologies? Which one is the most secure?