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
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 |
Answer / ramkumar
int func(int a,int b)
{
int ans;
ans = a - 2^b;
return ans;
}
| Is This Answer Correct ? | 0 Yes | 7 No |
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
How can I change the size of the dynamically allocated array?
How many levels deep can include files be nested?
1.Why do you call C is middle level language? 2.Why do you call C is userfriendly language.
How to avoid structure padding in C?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
How to write a code for reverse of string without using string functions?
Differentiate between #include<...> and #include '...'
Input is "Jack and jill went up a hill" To print output is 1-letter word(s)-1 2-letter words-1 3-letter words-1 4-letter words-4
What is use of bit field?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
What is calloc in c?