Which compiler you are using?
It is turbo c++ compiler....
It works for me. Is your file name .c or .cpp . Try to have it as .c file and also remember that some other program compiles correctly and then try to compile the above program so that you know what is the problem.
i saved the file with .c extension but still it is giving errors. Kindly check I am attaching the screenshot herewith: