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 pointer to pointer in c?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
what type of questions arrive in interview over c programming?
Which one would you prefer - a macro or a function?
What is a pointer value and address in c?
Are there namespaces in c?
Why do we use header files in c?
Why main function is special give two reasons?
How do I determine whether a character is numeric, alphabetic, and so on?
What is volatile variable in c with example?
Why do we need a structure?
write a program to copy the string using switch case?
Which is best linux os?
What will the preprocessor do for a program?