Sorry for being such a noob before and asking for help without trying prior to posting. In any case I've figured out most of my program, I'm just having trouble getting my program to display the line numbers before to the lines of text. This is what I have so far:

Code:
#include <stdio.h>
#define LINE_LENGTH 80

int main()
{
    FILE *fp = fopen("test.txt", "r");
    char line[LINE_LENGTH];
    while (fgets(line, LINE_LENGTH, fp) != NULL) 
    {
          printf( "%s", line);
    }
    getchar();
}