To set an environment variable from C, use putenv() or setenv()
As an aside, in the shell, if you only want to set or change the variable for one command but otherwise keep it as it is, the
export is superfluous.
Code:
LANG=hi_IN.UTF-8 gedit
will start gedit with LANG set to that value without affecting its value in the current shell or other commands started from it.