answersLogoWhite

0


Best Answer

22 XOR 35 = 53

Note 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 = 22

It can also be seen that:

22 XOR 53 = 35

It 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.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you convert 35 into 53 using bitwise operators?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the bitwise OR of 35 with 7 in C?

35 OR 7 is 39. To see how this works, write the values in binary, one directly above the other: 00100011 (35) 00000111 (7) Each column provides the two input operands for the OR operator. The output is derived from the following truth table: 0 or 0 = 0 0 or 1 = 1 1 or 0 = 1 1 or 1 = 1 Thus when the column has two 0s, we output a 0, otherwise we output a 1. Repeating this for all columns we find the following output: 00100111 Converting this to decimal we can see that 35 OR 7 must be 39.


How do you convert capital to lower string in c using asc code?

#include<stdio.h> #include<conio.h> #include<string.h> void main() { char str[99]; int i,len=0; clrscr(); printf("Enter the string \n"); while ( i!=\n) scanf("%s",str[i]); len=strlen(str[i]); //Printing the accepted value. for(i=1;1<len;++i) { printf("%s",str[i]); } //Converting the case. for(i=0;i<len;++i) { if(str[i]>='A' && str[i]<='Z') { str[i]+=35; } else { str[i]-=35; } } //Printing the string converted string. for(i=0;i<len;++i) { printf("%s",str[i]); } getch(); }


What is the lifespan of a elevator?

35 years


How many seconds are there in 35 years?

2759400000--------------- original answer above is way too big, improved below -----------There are 36 possible answers,depends on how many leap years in those 35 years,starting the normal 35 years (no leap years):60 * 60 * 24 = 86400 seconds/day86400 * 365 * 35 = 1103760000 seconds / normal yearfor 1 leap years in those 35 : 1103760000 + 86400 = 1103846400for 2 : 1103760000 + 86400 * 2for 3 : 1103760000 + 86400 * 3...for 35 leap days: 1103760000 + 86400 * 35 = 1106764000so, the answer is between [1103760000,1106764000]


How long would it take to purge a 15-ft section of 6-in.-diameter pipe using a flow rate of 35 cfh in tig?

Area equal pi * r^2. Diameter of six equals radius of three. So according to Google, 9 * pi * (15*12) = 5089 cubic inches. Now, again according to Google, 35 (ft^3) = 60 480 in^3 per hour. I'm going to leave you to figure out the answer from here!