Set and Clear GPIO Bit
In embedded systems, GPIO pins are usually controlled using memory-mapped registers.
You are given an 8-bit GPIO register value as input.
Write a C function that: - Sets bit 5 (0-indexed from LSB) - Clears bit 2 - Returns the modified register value
This simulates low-level GPIO manipulation commonly used in embedded firmware and device drivers.
1unsigned char modify_gpio(unsigned char reg) {2 // Set bit 5 and clear bit 23 return 0;4}