ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
Find Index of least significant bit set in an Integer. ex.
int value is say 10001000 results should be 4.
 Question Submitted By :: Bhagwat
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.
Answer
# 1
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 ?    2 Yes 0 No
Supri
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
which operator having highest precedence? a.)+ b.)++ c.)= d.)%  3
in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?  6
pgm to find middle element of linklist(in efficent manner) Huawei2
write a fuction for accepting and replacing lowercase letter to'Z' with out using inline function. Temenos4
Is it possible to run a c program without using main?If yes HOW?? Wipro10
what is available in C language but not in C++?  1
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } what is the output? Ramco4
Write a program in c to input a 5 digit number and print it in words.  1
print the following using nested for loop. 5 4 3 2 1 1 2 3 4 3 2 1 1 2 1 2 1 1 2 3 4 3 2 1 1 2 3 4 5  5
given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the array which of the following is incorrect? a.*(a+5) b.a[5] c.pa[5] d.*(*pa + 5) TCS5
What is false about the following A compound statement is a.A set of simple statments b.Demarcated on either side by curly brackets c.Can be used in place of simple statement d.A C function is not a compound statement. TCS1
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer  1
What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?  3
write a program for size of a data type without using sizeof() operator?  7
without using arithmatic operator solve which number is greater??????????  1
What compilation do? Geometric-Software7
any string of bits of length 'n' represents a unique non- negative integer between.............?  2
What are the commands should be given before weiting C Program i.e, Cd.. like Infonet3
the operator for exponencation is a.** b.^ c.% d.not available TCS4
write a c programs to do multiplication of two numbers with out using arithmatic operator ?????????? TCS4
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com