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.

Answers were Sorted based on User's Feedback



Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of..

Answer / sandeep ambekar

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 ?    5 Yes 2 No

Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of..

Answer / ramkumar

int func(int a,int b)
{
int ans;
ans = a - 2^b;
return ans;
}

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More C Interview Questions

Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

0 Answers  


What is variable declaration and definition in c?

0 Answers  


Which of these functions is safer to use : fgets(), gets()? Why?

0 Answers  


What is Function Pointer? Explain with example?

3 Answers  


player is good if the following conditions are satisfied: He is either from “India”, “Japan” or “Korea” He has a minimum of 3 years of experience He has won at least 3 major tournaments, and one of them must be "World Championship Tournament". He must know more than 10 techniques. (but see next question) If he knows less than 10 techniques, then he must be a world champion. His name contains at least 3 words. For example "Sachin Tendulkar" will not meet this condition. Write a method: boolean isGoodPlayer(String name, String country, int yearsExperience, String[] majorTournamentsWon, String[] techniques, boolean isWorldChampion) name country yearsExperience majorTournamentsWon techniques isWorldChampion

1 Answers  






What is the function of multilevel pointer in c?

0 Answers  


What is string in c language?

0 Answers  


Explain what is the difference between null and nul?

0 Answers  


String concatenation

2 Answers  


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

0 Answers  


Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….

1 Answers  


Why do some versions of toupper act strangely if given an upper-case letter?

0 Answers  


Categories