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 |
DIFFERNCE BETWEEN THE C++ AND C LANGUAGE?
What is the Difference between Macro and ordinary definition?
3 Answers Bosch, Cognizant, College School Exams Tests, Motorola,
What are the back slash character constants or escape sequence charactersavailable in c?
main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}
Can U write a C-program to print the size of a data type without using the sizeof() operator? Explain how it works inside ?
a=0; while(a<5) printf("%d\n",a++); how many times does the loop occurs? a.infinite b.5 c.4 d.6
What is wrong with this statement? Myname = 'robin';
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }
What is masking?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
What is multidimensional arrays