how to set Nth bit of a variable?
Answer / kirankumaryakkala
ex: int res=16, temp=1,n;
printf("enter the Nth bit no");
scanf("%d",&n);
temp=temp<<n; //leftshift to ntimes
res=res|temp; //bitwise OR
printf("setted nth bit of res %d",res);
| Is This Answer Correct ? | 9 Yes | 4 No |
What 'lex' does?
#include<stdio.h> #include<conio.h> # define swap(a,b) temp=a; a=b; b=temp; void main( ) { int i, j, temp; i=5; j=10; temp=0; if( i > j) swap( i, j ); printf( "%d %d %d", i, j, temp); }
Identify the operators that is not used with pointer a. && b. # c. * d. >>
How do you initialize function pointers? Give an example?
What is the use of keyword VOLATILE in C?
write a program to display the frequency of each element in a given array in c language
Explain what is operator promotion?
Explain how can I avoid the abort, retry, fail messages?
What will be the output of following program #include main() { int x,y = 10; x = y * NULL; printf("%d",x); }
What are macros in C?
struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(ā%dā,s.x); }
write a program for 7*8 = 56 ? without using * multiply operator ? output = 56