You do several things wrong:
- You don't verify the file exist,
- You don't verify you got a valid file pointer after fopen
- You most likely didn't put the file "op.DAT" in the working directory of you application which you setup in the project options.
- If you are on Linux: you need to check the file's name as it is case sensitive (a capital letter extension is very un-common on such platforms)
- You said nothing about your build environment -> platform (OS), version etc...
Fixing all this will probably make you app working.
BTW: As this is not related to Code::Blocks, but a general programming question I am locking the topic now.