answersLogoWhite

0


Best Answer

main()

{

int num=0xABCD;

printf("%x\n",num);

int rev=0x0;

int digit=0x0;

while(num!=0x0)

{

digit=num%0x10;

rev = rev*0x10 +digit;

num=num/0x10;

}

printf("%x\n",rev);

}

User Avatar

Wiki User

โˆ™ 2008-09-16 12:30:46
This answer is:
User Avatar
Study guides

What is a programming language

What does DOS stand for

What is a software that is distributed for free

What do unix and Linux have in common

โžก๏ธ
See all cards
3.91
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
53 Reviews

Add your answer:

Earn +20 pts
Q: How to Reverse a hexadecimal number using bitwise?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

What is hexadecimal number?

The hexadecimal number system is one using 16 as the base instead of the more familiar ten which we use in the decimal system.


What is Hexadecimal Number systeam?

The hexadecimal number system is one using 16 as the base instead of the more familiar ten which we use in the decimal system.


When you count to 15 using hexadecimal numbers the highest number is what?

The answer is 15.


Which is the code to multiply a number num1 by 2 using bitwise operator in c?

num1 <<= 1; /* shift left */


Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.


What is the equivalent hexadecimal number for 13?

13 = D in hex. If you're using two digits to represent the hex number - its 0D


What are the steps for using a free reverse phone number lookup?

The steps for using a free reverse phone number lookup are: go to a website like Reverse Number Direct, type in the relevant information and then you'll get results.


How may an individual find a phone number using a reverse directory?

An individual can find a phone number using a reverse directory by inputting the phone number in the space provided in the reverse directory and pressing enter. This will produce the desired results if the phone number is not an unlisted number.


Reverse of the number using only while loop?

apple


How do you convert 35 into 53 using bitwise operators?

22 XOR 35 = 53Note that the value 22 is a magic number because it only works for the values 35 and 53. The value 22 was calculated as follows:35 XOR 53 = 22It can also be seen that:22 XOR 53 = 35It is assumed that you are actually looking for some bitwise operation that will reverse the digits in any number. You cannot do this because in order to determine the magic number for any given value, you first need to XOR the value with the reverse of the value, which means you must already know the reverse of the value.To reverse any value that is not a multiple of 10, use the following function:unsigned reverse (unsigned num) {unsigned rev;rev = 0;while (num) {rev *= 10;rev += num % 10;num /= 10;}return rev;}Note that reverse(10) is 1, not 01. If you want to convert trailing zeroes into leading zeroes, convert the number to a string and then reverse the string, returning the string rather than the numeric value.


What a hexadecimal code?

It is a representation of numbers using 16 as the base.


How develop c plus plus program that swap two number with out using temporary variable?

To swap two numbers without using a temporary variable, use the bitwise exclusive or function... A^=B; B^=A; A^=B;

People also asked