C provides a built-in getenv function that retrieves system variable information in a C program. The return type of this function is a C pointer to the value in the environment. It takes the character value as an argument and returns the results if there is a variable in the environment list, otherwise it prints the NULL value. Here's the code example:-