Hi,
Please help me write this C code as i am clueless and helpless in C programming

Write a C program, which allows the user to enter a valid filename and then prints the file content to screen, two lines at a time. The program should pause after displaying the first two lines, after which the user could either hit the ‘Q’ key to exit the program or ‘ENTER’ key to continue to print the subsequent two lines to the screen, until the end of file.

For example, if the text file contains: 
    Welcome to Hilton Hotel 
    The best hotel for all your needs
    Book Hotel Now  

    then the following will be printed on screen:
        Welcome to Hilton Hotel 
        The best hotel for all your needs
        Hit ‘Q’ to exit or ‘ENTER’ to continue.

        If the user hits the ‘ENTER’ key, the following will be printed on screen:
        Book Hotel Now

     If the user hits the ‘Q’ key, the following will be printed on screen:
        Program exited before end of file

Thanks in advance

I've identified the problem

clueless and helpless in C programming

If you have no idea how to program in C, then the only way I can possibly see you getting this assignment done is to learn C. I don't see how you are going to get it done otherwise. If you know how to program in C, try the question yourself first. If you're stuck, we'll help. If you have a specific question, we'll help.

We wont do it for you; because that doesn't really help anyone, does it?

This question has already been answered. Start a new discussion instead.