Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / sumit kumar

Take the input 5 from keyword :-
#include<stdio.h>
main()
{
int num,pos;
printf("enter the no.:");
scanf("%d",&num);
printf("enter the position:");
scanf("%d",&pos);
if(num & (1<<pos))
{
printf("pos is set");
}
else
{
printf("pos is not set");
}
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is a pointer a kind of array?

1245


Is there any data type in c with variable size?

1145


What are the 32 keywords in c?

1140


Difference between Function to pointer and pointer to function

1129


What is c language & why it is used?

1174


What is the main difference between calloc () and malloc ()?

1231


Differentiate between declaring a variable and defining a variable?

1089


what is the height of tree if leaf node is at level 3. please explain

2199


Write a Program to accept different goods with the number, price and date of purchase and display them

6296


Can the curly brackets { } be used to enclose a single line of code?

1216


How can I recover the file name given an open stream or file descriptor?

1135


What are the header files used in c language?

1094


how many key words availabel in c a) 28 b) 31 c) 32

1129


What is pointer & why it is used?

1172


what is the role you expect in software industry?

2198