static void WriteFinalResult(double result) { TextWriter file = new StreamWriter("result_final.txt", true); file.WriteLine(result); file.Close(); }