Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
get_bit
//Title of this code //gcc 4.9.2 #include <stdio.h> int main(void) { int input = 0x1; int N = 1; // Position of the bit you want to extract // Creating the mask unsigned int mask = 1 << (N-1); // Applying the mask unsigned int result = (input & mask) ? 1 : 0; printf("Result after mask: %d\n", result); }
run
|
edit
|
history
|
help
1
c union bytes affected
C141106_TablaMultiplicar
romitk
sizeof human
Project 3 part 2 Book v1.1
PART 2
new
18BCE2182 ASSESS_1 Q2-3
18BCE2182 ASSESS_2 Q1
Conflito entre 4 threads