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 / 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 ?    18 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the collection of communication lines and routers called?

1072


what is the difference between class and unio?

2308


Is sizeof a keyword in c?

923


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

2141


Write a program to print factorial of given number using recursion?

966


How many levels of indirection in pointers can you have in a single declaration?

1037


The file stdio.h, what does it contain?

1125


Why functions are used in c?

1083


How are strings stored in c?

984


What is external variable in c?

1020


What is atoi and atof in c?

1040


What are the key features in c programming language?

1020


what are non standard function in c

1863


What is union and structure?

1052


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

1058