주어진 위치에서 원하는 bit 수만큼 int 타입으로 추출
// extract k bits from a given position. #include // Function to extract k bits from p position // and returns the extracted value as integer int bitExtracted(int number, int k, int p) { return (((1 > (p - 1))); } // Driver code int main() { int number = 171, k = 5, p = 2; printf("The extracted number is %d", bitExtracted(number, k, p)); return 0; }