Multiple choice technology programming languages

How can I get/set an environment variable from a program?

  1. getenv(), setenv()

  2. getenv(), putenv()

  3. readenv(), writeenv()

  4. You cannot environmement variables inside a program

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Standard C library functions for environment variables are getenv() to retrieve and putenv() to set/modify environment variables. Option A incorrectly pairs setenv() (which exists but putenv() is the more common POSIX standard). Option C uses non-existent function names. Option B correctly pairs getenv() and putenv().