answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

void main(void)

{

FILE *fp;

char ch;

int count=0;

clrscr();

fp=fopen("seo.c","r");

while((ch=fgetc(fp))!=EOF)

{

if(ch=='\n')

{

count++;

printf("%d\n",count); }

else

printf("%c",ch);}

fclose(fp);

getch();

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a C program that reads the contents of a text file and print the contents to the screen line by line preceded by line number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How can you make a splash screen in c or c plus plus?

Many people use a modified version of the program's About dialogue window as a splash screen, but you can also create a dedicated splash screen window that contains an image of the company logo along with some program information. The choice is yours but ultimately a splash screen is nothing more than a window that is shown while a program loads in the background. When the program has loaded, the splash screen is closed automatically. The simplest method of displaying your splash screen is to use a program loader function. Typically this will be your program's main function or a function called from your main function. The program loader first loads and displays the splash screen, then loads the rest of your program in the background before closing the splash screen window and finally showing the main window. Some splash screens display progress information during the load sequence, thus your program loader should send messages to the splash screen and give time to the system to allow messages to be processed. This will increase the time it takes to load your program, but if the load process is lengthy to begin with, it is better to give some indication of the progress.


What is ffmpeg?

It is a screen recorder like Joyoshare VidiKit - Screen Recorder that can help you record online music, video games. lectures and more.


How you can freeze screen for viewer in teamviewer Or how u can make viewer fool by freeze one screen?

There was a program , but now it's fixed and there is other program but i don't know muc habout it myself


Why not full screen picture on LCD TV?

program could be widescreen


How do you full screen the GW basic program?

gust click the ALT+ENTER

Related questions

What are some ways to use the print screen button on the keyboard?

The print screen button is extremely useful if a photo of the contents of the monitor's screen is required. Simply press the button, and then open a graphics software program, such as Microsoft Paint. By selecting 'paste', the screen capture will then be transferred into your Paint program ready to be edited.


How do you take a screenshot using prtsc?

Press the Print Screen key and youu will get the full screen screenshot of the contents of the screen saved to the clipboard(Windows.) Going to a program that does graphics(many freely available) and and pressing Ctrl + V will paste it there so that it can be saved or manipulated.


How can you paste the contents of a screen in a word document?

you look for a a key on your keyboard that says print screen (prtscrn) then you paste it where you want it


Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


How do you calculate the number of pixels in an inch?

The number of pixels in an inch of a photo or a screen or a camera is given by the software. You can change it if the program alow you to do so. Thanks rylwy


What is a monitor program in a computer?

the screen


What is the screen list of options in a program that tells you what is in that program?

menu


What other program's there are to film like hypercam?

BSR Screen Recorder is another screen recorder program check the related link.


What is the use of more command in unix?

The 'more' command is considered a 'pager' program, which means it displays 1 screen page at a time as it pages through the file. This program allows you to look at the contents of a file one screen at a time, at your speed ..


Can you give me a program that will compute number 1 to 5?

nr\m;laeoh9y0m g.qthnedxc In fortran: do i=1,5 write(6,*)i enddo stop end This program will write the numbers 1 to 5 on the screen.


How do you print screen a page?

On an IBM PC type of computer, this is done by pressing the "Print Scrn" key on the keyboard. Normally, this does not send the screen display directly to the printer, but copies the screen to a temporary storage area called the "clipboard". One would then start up a graphics program to import the clipboard contents, save the image as a file and send it to one's printer if hard copy is needed.


What do screens do?

A screen shot takes a picture of what is on the screen and saves it to your clipboard. You can then paste it in an imaging program.