how to find a 5th bit is set in c program

Answer Posted / valli

main()
{
int n;
printf("enter n:");
scanf("%d",&n);
if(n&(1<<5);
printf("5th bit in %d is set",n);
}

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?

2146


Why we write conio h in c?

754


Implement bit Array in C.

869


Differentiate between Macro and ordinary definition.

964


What is difference between constant pointer and constant variable?

903


What are the 5 data types?

770


How can type-insensitive macros be created?

906


How many bytes is a struct in c?

893


What is %lu in c?

895


What is the use of void pointer and null pointer in c language?

827


What is pass by reference in functions?

516


What are the rules for identifiers in c?

795


a program that can input number of records and can view it again the record

1682


Can a file other than a .h file be included with #include?

867


Why c is called object oriented language?

798