Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Find Index of least significant bit set in an Integer. ex.
int value is say 10001000 results should be 4.



Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should..

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

Post New Answer

More C Interview Questions

Where we use clrscr in c?

0 Answers  


what is the function of .h in #include<stdio.h> in c ?

23 Answers   HCL, IBM, Wipro,


Why do we need functions in c?

0 Answers  


What is operator promotion?

0 Answers  


How to convert decimal to binary in C using recursion??

4 Answers   HP, IBM,


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

0 Answers  


How a string is stored in c?

0 Answers  


What is main () in c language?

0 Answers  


Write a program to print fibonacci series without using recursion?

0 Answers  


What are the loops in c?

0 Answers  


Differentiate between new and malloc(), delete and free() ?

0 Answers   iNautix,


How can I prevent another program from modifying part of a file that I am modifying?

0 Answers  


Categories