Is there any way by which I can change to any directory by executing a C program?
Well, the POSIX command for changing the current directory is:
chdir(const char*path);
See the recent POSIX documentation for chdir() is here.