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 kind of structure is a house?
What is substring in c?
Can we change the value of #define in c?
Explain what are reserved words?
What are the types of variables in c?
List some of the dynamic data structures in C?
What are the benefits of organizational structure?
What are the functions to open and close file in c language?
how to count no of words,characters,lines in a paragraph.
Explain enumerated types.
What is the difference between fread buffer() and fwrite buffer()?
What is wrong in this statement? scanf(ā%dā,whatnumber);
What is the difference between arrays and pointers?
How do you use a pointer to a function?
Explain the Difference between the New and Malloc keyword.