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 difference between Printf(..) and sprint(...) ?

1547


What is wrong with this program statement?

1046


What is the significance of scope resolution operator?

1419


Is it better to bitshift a value than to multiply by 2?

1094


Write a program to check whether a number is prime or not using c?

1063


What are the characteristics of arrays in c?

1054


What is the difference between arrays and pointers?

1136


What is getche() function?

1053


How do you determine whether to use a stream function or a low-level function?

1132


How can I prevent another program from modifying part of a file that I am modifying?

1063


What is the use of sizeof () in c?

1059


Do you know what are the properties of union in c?

1083


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1232


How to write a code for reverse of string without using string functions?

2154


What are the advantages of the functions?

1164