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 |
What is the use of parallelize in spark?
How can we allocate array or structure bigger than 64kb?
Go through this linked list concept.While traversing through the singly linked list sometimes the following code snippet "while(head != NULL)" is used and other times "while(head->link != NULL)"is used(Here head is the pointer pointing to the first node,node has two parts data part and link part).What is the difference between head != NULL and Head->link != NULL and in which situation are they used?
Is c dynamically typed?
Explain #pragma statements.
Is there anything like an ifdef for typedefs?
void main() { int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} }; int (*p)[2]; int i,j,*pint; for(i=0;i<=3;i++) { p=&s[i]; pint=p; printf("\n"); for(j=0;j<=1;j++) printf("%d",*(pint+j)); } } while running this program it shows a warning-suspicious pointer conversion ie pint=p; my que is why should we assign the value of p to pint again.why cant we use it directly as *(p+j)..but if i use like tat the o/p is garbage value..
I need a sort of an approximate strcmp routine?
Why do we need a structure?
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } what is the output?
15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?
What functions are used in dynamic memory allocation in c?