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

What is the difference between printf and scanf )?

1104


What is the use of header?

1095


State two uses of pointers in C?

1065


Can a pointer be static?

1091


What is difference between && and & in c?

1111


Why do we use int main instead of void main in c?

1155


What is the size of enum in c?

1121


What are c identifiers?

1102


Explain what header files do I need in order to define the standard library functions I use?

1175


Is it cc or c in a letter?

1029


How can you determine the size of an allocated portion of memory?

1315


What is the difference between procedural and declarative language?

1150


Explain the use of 'auto' keyword in c programming?

1121


What is C language ?

1972


List a few unconditional control statement in c.

991