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 difference between array_name and &array_name?
Why do we need a structure?
What is New modifiers?
Explain function pointer with exapmles.
why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?
Hi Every one...........I have been selected for the SBI Clerk. But i m one month Pregnanat. So anyone please suggest me, is they take any objection on my joining .
4 Answers State Bank Of India SBI,
#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?
What are the different types of objects used in c?
When should the const modifier be used?
Describe advantages and disadvantages of the various stock sorting algorithms
what is difference between array and structure?
44 Answers College School Exams Tests, CTS, Google, HCL, IBM, Motorola, TCS,
what is the coding of display the factorial of a number using array and function?