write a c program to check weather a particluar bit is set
or not?
Answer Posted / valli
#include<stdio.h>
main()
{
int n,p;
printf("enter number");
scanf("%d",&n);
printf("enter the position");
scanf("%d",&p);
if(n&(1<<p))
printf("the bit is set");
else
printf("the bit is clear");
}
| Is This Answer Correct ? | 12 Yes | 3 No |
Post New Answer View All Answers
What is variables in c?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
Is malloc memset faster than calloc?
What are the different properties of variable number of arguments?
What is the condition that is applied with ?: Operator?
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
Which is best linux os?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Why main function is special give two reasons?
Difference between MAC vs. IP Addressing
State the difference between realloc and free.
What are the 5 types of inheritance in c ++?
What does the characters “r” and “w” mean when writing programs that will make use of files?
Explain a pre-processor and its advantages.
What is the 'named constructor idiom'?