using System;
using System.IO;
namespace FileWrite
{
class Program
{
static void Main(string[] args)
{
string sentence = " ";
StreamWriter myfile;
myfile = File.CreateText("test.txt");
do
{
Console.Write("Enter a sentence: ");
sentence = Console.ReadLine();
if (sentence.Length != 0)
{
myfile.WriteLine(sentence);
}
}
while (sentence.Length != 0);
myfile.Close();
}
}
}