Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Exercise_1
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. using (StreamReader reader = new StreamReader("TextFile1.txt"))
  15. {
  16. int lineNumber = 0;
  17. string line = reader.ReadLine();
  18. while (line!=null)
  19. {
  20. if (lineNumber%2!=0)
  21. {
  22. Console.WriteLine(line);
  23. }
  24. lineNumber++;
  25. line = reader.ReadLine();
  26. }
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement