CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 22:42:38 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=3d9baa13999df3dfbc3589f0c00f5a16ad2bc4b0ea741931f716feabb01a010ca%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22OnVoBNS27Do5SPgX2dcbHl4eK_HCVXrO%22%3B%7D; HttpOnly; Path=/
cf-ray: 98da1c8b4e351ec2-BLR
} putchar('\n');}/* 2. a) Write a function that takes a 32- - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }
- putchar('\n');
- }
- /* 2. a) Write a function that takes a 32-bit unsigned
- * and returns the 16-bit number formed by the bits in
- * even positions.
- * I.e., if we label the bits. 0xBA9876543210, return the
- * number formed by bits0xA86420.
- * b)The same problem, but place the bits in reverse order.
- */
- unsigned reverseBits (unsigned n){
- unsigned result = 0, bitSize = sizeof(unsigned) * 8;
- int i;
- for (i = 0; i < bitSize; i++){
- result = result | (1 & n);
- n = n >> 1;
- if(i + 1 < bitSize){
- result = result << 1;
- }
- }
- return result;
- }
- unsigned evenPositions32b (unsigned n){
- unsigned result = 0;
- int i;
- for (i = 0; i < 16; i++){
- result = result | ((1 << i) & n);
- n = n >> 1;
- }
- return result;
- }
- int main(){
- int a = 0xAF;
- printf("even positions on a reversed would be %x\n", reverseBits(evenPositions32b(a)));
- printf("even positions on a would be %x", evenPositions32b(a));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐Make $1500 in 20 minutes⭐⭐
Java | 1 sec ago | 0.15 KB
-
💎 ChangeNOW Exploit
JavaScript | 1 sec ago | 0.24 KB
-
✅ Make $2500 in 20 minutes⭐ F
JavaScript | 3 sec ago | 0.25 KB
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 8 sec ago | 0.15 KB
-
🚨 Free Crypto Method 🚨
JavaScript | 10 sec ago | 0.24 KB
-
⭐⭐⭐GMAIL Logs (2FA disabled)⭐⭐
Java | 12 sec ago | 0.15 KB
-
📌 Swapzone +37% glitch ⭐ J
JavaScript | 12 sec ago | 0.25 KB
-
PlacablePreset-Starter6 10:42:19 PM
Lua | 14 sec ago | 0.08 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand