How to read/write from file, string search

I need help with my university task. I'm not used to C and I get many errors. I am not sure how to get started.

I have to write a program, it contains a menu. The task is to find how much if/if else statements a program.c file has (I use my main.c as an example). And the number of blocks the program has ( { }). The menus have the options:

  1. Read from file save the result in a file.

  2. Read from console print result on the console.

  3. Console to file.

  4. File to console.