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
how can f be used for both float and double arguments in printf? Are not they different types?
What are header files and explain what are its uses in c programming?
What are pointers really good for, anyway?
What is the concatenation operator?
Why dont c comments nest?
Explain what header files do I need in order to define the standard library functions I use?
Create a simple code fragment that will swap the values of two variables num1 and num2.
Why can’t we compare structures?
I have seen function declarations that look like this
What is the difference between memcpy and memmove?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
How can you pass an array to a function by value?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
What is signed and unsigned?
Explain 'far' and 'near' pointers in c.