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...

write a c program to check weather a particluar bit is set
or not?

Answer Posted / valli

#include<stdio.h>
main()
{
int n,p;
printf("enter number");
scanf("%d",&n);
printf("enter the position");
scanf("%d",&p);
if(n&(1<<p))
printf("the bit is set");
else
printf("the bit is clear");
}

Is This Answer Correct ?    12 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What kind of structure is a house?

1048


What is substring in c?

1209


Can we change the value of #define in c?

1001


Explain what are reserved words?

1107


What are the types of variables in c?

1024


List some of the dynamic data structures in C?

1249


What are the benefits of organizational structure?

1031


What are the functions to open and close file in c language?

1207


how to count no of words,characters,lines in a paragraph.

4432


Explain enumerated types.

1040


What is the difference between fread buffer() and fwrite buffer()?

1185


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

1245


What is the difference between arrays and pointers?

1131


How do you use a pointer to a function?

1090


Explain the Difference between the New and Malloc keyword.

1143