NextGen Healthcare Interview Question: Write a program in any langua... | Glassdoor

Interview Question

Senior Software Engineer Interview Houston, TX

Write a program in any language you like that takes a

  filename and a number N as arguments and retrieves and outputs the Nth line from the file.

Interview Answer

1 Answer


// C# code

function readNthLine(string fileName, nthLine)
String[] FileContents =System.IO.File.ReadAllLines(fileName);
String nThLine=FileContents[nThLine ]; //Read the Third Line
 //Because the Index will start from 0, I have read the 2 . So that You will get the thrid Line

Interview Candidate on Jan 27, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.