" No file or such directory"error mostly comes when there is an error in header file.But when seeing your question I came to know that your code does not suffer from the error.
The error may be associated with your compiler.You may not installed it correctly.Try reinstalling your program.Or you can try downloading MinGW compiler(common compiler used by free IDE's) from
www.equation.com according to your specifications (32 or 64 bit) or try using others like codeblocks, Bloodshed Dev C++
etc., etc.,