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

Explain what is the benefit of using enum to declare a constant?

1020


What is string length in c?

1026


What is calloc()?

1026


What does *p++ do? What does it point to?

1004


Describe how arrays can be passed to a user defined function

1224


What is difference between scanf and gets?

1169


What is function prototype in c with example?

1003


What are all different types of pointers in c?

957


What is #include stdlib h?

1056


What are linked lists in c?

1085


What is anagram in c?

874


Why c language?

1006


Where register variables are stored in c?

909


Where can I get an ansi-compatible lint?

1100


What are linker error?

1036