Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.IO;
- namespace _01.PrintOddLines
- {
- class Program
- {
- static void Main(string[] args)
- {
- using (StreamReader sw = new StreamReader("../../mytemp.txt")) //the dir of the .cs file
- {
- int lineNumber = 1;
- string line = sw.ReadLine();
- while (line!=null)
- {
- if (lineNumber%2 != 0)
- {
- Console.WriteLine(line);
- }
- lineNumber++;
- line = sw.ReadLine();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement