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

Is c still used?

0 Answers  


What does static variable mean in c?

0 Answers  


How can I change their mode to binary?

0 Answers  


how to print "hai" in c?

13 Answers   TCS,


Explain which function in c can be used to append a string to another string?

0 Answers  






Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.

7 Answers   Accenture, Gridco, IBM, Kevin IT, TCS, Vimukti Technologies,


what are the advantages & disadvantages of unions?

2 Answers  


What does *p++ do?

0 Answers  


Why c is a procedural language?

0 Answers  


Explain the difference between strcpy() and memcpy() function?

0 Answers  


Write a program to find the number of times that a given word(i.e. a short string) occurs in a sentence (i.e. a long string!). Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing. Typical output should be: The word is "the". The sentence is "the cat sat on the mat". The word occurs 2 times.

0 Answers  


What are terms in math?

0 Answers  


Categories