write a c program to check weather a particluar bit is set
or not?
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 ? | 33 Yes | 12 No |
Post New Answer View All Answers
What is the difference between malloc() and calloc() function in c language?
What is c system32 taskhostw exe?
What is the purpose of scanf() and printf() functions?
Why do we use pointer to pointer in c?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
What does s c mean on snapchat?
Can one function call another?
What are unions in c?
What does 3 periods mean in texting?
provide an example of the Group by clause, when would you use this clause
What are the types of pointers?
What are the scope of static variables?
What is the use of pointers in C?
Subtract Two Number Without Using Subtraction Operator
What does s c mean in text?