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 exchnage bits in a byte
b7<-->b0 b6<-->b1 b5<-->b2 b4<-->b3
please mail me the code if any one know to
rajeshmb4u@gmail.com

Answer Posted / santhi perumal

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

int main()
{
int i,number,count=0,a[100];

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

for(i=7;i>=0;i--)
{
if((1<<i) & number)
a[count] = 1;
else
a[count] = 0;

count++;
}

printf("Binary Value of the Given Number is:\n");
for(i=0;i<=7;i++)
{
printf("%d",a[i]);
}
printf("\nReversed Binary Value of the Given Number is:\n");
for(i=0;i<=7;i++)
{
printf("%d",a[7-i]);
}
printf("\n");
}

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between variable declaration and variable definition in c?

1037


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

1030


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1759


Explain what are multidimensional arrays?

1019


Why doesnt this code work?

1022


What is a program flowchart and how does it help in writing a program?

1105


What is the -> in c?

970


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

1120


What is the size of a union variable?

1023


What are # preprocessor operator in c?

1061


cavium networks written test pattern ..

4043


What is pre-emptive data structure and explain it with example?

3680


What does sizeof return c?

1024


Explain a file operation in C with an example.

1070


How can I swap two values without using a temporary?

1077