write a c program to check weather a particluar bit is set
or not?
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int m,n,o,p;
printf("enter the number :");
scanf("%d",&m);
printf("enter the bit position for checking it is set or reset :");
scanf("%d",&n);
o=m;
p=o>>(n-1);
p=p&1;
if(p==1)
printf("the bit is set");
else
printf("the bit is reset");
getch();
}
thank u
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Why is sizeof () an operator and not a function?
Explain what is the difference between text files and binary files?
Do you have any idea about the use of "auto" keyword?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
Why is c so important?
What is #include stdio h and #include conio h?
write a c program to find the sum of five entered numbers using an array named number
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What are integer variable, floating-point variable and character variable?
Does c have an equivalent to pascals with statement?
What is the advantage of c?
What header files do I need in order to define the standard library functions I use?
What is a keyword?
In c programming language, how many parameters can be passed to a function ?
What is static memory allocation?