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
eliminate_duplicates.c
4qwrfdsfsaf
Is const really const?
150112_FuncionesOrdenArray
20171117_TARTAGLIA
Coba
Goodone for understanding array passing
Ascii contrasena segura
CO_assign_q4
ATM