develop a program that when you pipe in a file it will demonstrate on the left had side the line number. I need this to work by having a program piped in and when a \n occurs a new line and number is indicated. Someone helped me earlier but that was only for character by character. for line by line. I know the basic set up I need need help executing this program.
#include
#include
int main(){
char inp[1000];
int i;
printf("Enter the input:\n");
scanf("%s", &inp);
for(i = 0; i < strlen(inp); i++){
printf("%d %c\n", i + 1, inp[i]);
}
return 0;
}