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 acronym for ansi?

997


What is the purpose of clrscr () printf () and getch ()?

1020


i got 75% in all semester am i eligible for your company

2171


What are types of preprocessor in c?

1014


Write a program of prime number using recursion.

1035


What is a stream?

1078


Write a code to generate a series where the next element is the sum of last k terms.

1168


What is the use of a ‘’ character?

1026


Why is c called "mother" language?

1228


explain how do you use macro?

1098


How many levels of pointers can you have?

1134


How will you delete a node in DLL?

1217


What does 1f stand for?

1085


What is the size of enum in bytes?

1035


What are the advantages of using Unions?

1066