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       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
Write a function that accepts two numbers,say a and b and 
makes bth bit of a to 0.No other bits of a should get 
changed.
 Question Submitted By :: Remya
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed.
Answer
# 1
int func(int  a,int b)
{
  int ans;
  ans = a - 2^b;
  return ans;
}
 
Is This Answer Correct ?    0 Yes 4 No
Ramkumar
 
  Re: Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed.
Answer
# 2
Macro to Set a particular Bit..
#define SetBit(x,y) x | 0x1<<y

Macro to Clear a particular Bit..
#define ClearBit(x,y) x & ~(0x1<<y)
 
Is This Answer Correct ?    3 Yes 1 No
Sandeep Ambekar
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
why division operator not work in case of float constant?  1
can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance IBM1
Program to display given 3 integers in ascending order N-Tech1
pick out the odd one out of the following a.malloc() b.calloc() c.free() d.realloc() TCS1
what is the differnce between AF_INET and PF_INET? Wipro2
How to set a variable in the environment list?  1
Find Error if any in below code, Justify ur answer: struct xx { int a; struct yy { char c; struct xx* p; } struct yy* q; } NDS3
what is the difference between getch() and getchar()?  5
if a person is buying coconuts of Rs10,and then sell that coconuts of Rs9,with the loss of one rupee.After that the person became a millaniore.how? Wipro5
which one low Priority in c? a)=,b)++,c)==,d)+  8
What do you mean by team??  2
read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX) x=1; else if(x<MIN) x=-1; x=50; if the initial value of x=200,what is the vlaue after executing this code? a.200 b.1 c.-1 d.50 TCS2
which type of question asked from c / c++ in interview.  2
char ch=10;printf("%d",ch);what is the output Accenture11
could u able to tell about suresoft technical session  1
What is a class?  2
helllo sir give me some information of the basic information the c as printf ,scanf , %d ,%f and why is the main use of these.  3
What is the most efficient way to count the number of bits which are set in a value?  3
main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}  3
biggest of two no's with out using if condition statement  2
 
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