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 / santhi perumal

#include<stdio.h>
#include<conio.h>

int main()
{
int number;
int position;
int result;

printf("Enter the Number\n");
scanf("%d",&number);
printf("Enter the Position\n");
scanf("%d",&position);

result = (number >>(position-1));

if(result & 1)
printf("Bit is Set");
else
printf("Bit is Not Set");
}

Is This Answer Correct ?    33 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a stream?

1146


Explain how can I remove the trailing spaces from a string?

1050


How can I change the size of the dynamically allocated array?

1151


What do you mean by keywords in c?

1153


What is %s and %d in c?

1047


What’s a signal? Explain what do I use signals for?

1113


What are the salient features of c languages?

1101


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

5238


What is static and auto variables in c?

1091


Why do some versions of toupper act strangely if given an upper-case letter?

1078


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1368


How do c compilers work?

1136


Write a program to print fibonacci series without using recursion?

1142


What is sizeof c?

1077


What oops means?

1001