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

What does the file stdio.h contain?

608


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2339


How are pointers declared in c?

603


How old is c programming language?

587


Explain void pointer?

595






Explain what is the benefit of using const for declaring constants?

620


What is use of integral promotions in c?

670


What is the general form of function in c?

618


What are the two forms of #include directive?

646


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

688


State two uses of pointers in C?

642


How can I copy just a portion of a string?

822


Can include files be nested? How many levels deep can include files be nested?

662


What are variables c?

626


What is difference between stdio h and conio h?

892