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 is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }
8 Answers MindFire, TCS, Tech Mahindra,
main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??
19 Answers EBS, Ramco, Sangwin, TCS,
write a program for egyptian fractions in c?
write a program in C to swap two variables
char ch="{'H','I',0};printf("%s",ch);what is output
Write a C program to perform some of the operation which can be performed using Single linked list
what will be the output for the following main() { printf("hi" "hello"); }
What are the two types of structure?
main() { unsigned int k = 987 , i = 0; char trans[10]; do { trans[i++] =(char) (k%16 > 9 ? k%16 - 10 + 'a' : '\0' ); } while(k /= 16); printf("%s\n", trans); }
Why double pointer is used in c?
What should not contain a header file?
Why doesn't C support function overloading?