Set and Clear GPIO Bit

Easy C Memory
Solve this problem

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.

Starter codeC
1unsigned char modify_gpio(unsigned char reg) {2    // Set bit 5 and clear bit 23    return 0;4}