How to check OpenGL version of currently running program?

As title says. I have some 3d opengl program and I wish to know which version is it using. Thanks.