Answer Posted / santhi perumal
#include<stdio.h>
#include<conio.h>
int main()
{
int number;
int position;
int result;
printf("Enter the Number\n");
scanf("%d",&number);
printf("Enter the Position\n");
scanf("%d",&position);
result = (number >>(position-1));
if(result & 1)
printf("Bit is Set");
else
printf("Bit is Not Set");
}
| Is This Answer Correct ? | 18 Yes | 7 No |
Post New Answer View All Answers
What is the difference between Printf(..) and sprint(...) ?
What is wrong with this program statement?
What is the significance of scope resolution operator?
Is it better to bitshift a value than to multiply by 2?
Write a program to check whether a number is prime or not using c?
What are the characteristics of arrays in c?
What is the difference between arrays and pointers?
What is getche() function?
How do you determine whether to use a stream function or a low-level function?
How can I prevent another program from modifying part of a file that I am modifying?
What is the use of sizeof () in c?
Do you know what are the properties of union in c?
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
How to write a code for reverse of string without using string functions?
What are the advantages of the functions?