Is there any way by which I can change to any directory by executing a C program?
chdir() changes only the current working directory of the process but not of the context in which you are working. Suppose you execute a program in the terminal and your current directory is /home/Documents, then on executing a program having the following lines
chdir("cd ../Downloads");
will not change the working directory of the terminal, but changes that of the process only.