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

I have a varargs function which accepts a float parameter?

0 Answers  


a linear linked list such that the link field of its last node points to the first node instead of containing NULL a) linked list b) circular linked list c) sequential linked list d) none

0 Answers  


What is the difference between void main and main in c?

0 Answers  


Write the test cases for checking a variable having value in range -10.0 to +10.0?

0 Answers   Bosch,


what is the advantage of function pointer

16 Answers   CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,


Write a program to generate the first n terms in the series --- 2,3,5,7,11,...,17

0 Answers  


convert 12345 to 54321 withoutusing strig

5 Answers  


Write a code to generate a series where the next element is the sum of last k terms.

0 Answers   Aspiring Minds,


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

1 Answers   Mind Tree,


What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }

1 Answers  


Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks.

3 Answers   Google,


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

0 Answers  


Categories