You have
string input=(Console.ReadLine()); // read from the keyboard
int num = Convert.ToInt32(input);
which is user keyboard input.
To read from the file you need
string input=(read.ReadLine()); // read from the stream reader
int num = Convert.ToInt32(input);