PROGRAM 11
#include <iostream.h>
#include <conio.h>
#include <fstream.h>
#include <process.h>
void main()
{
fstream fin;
char ch;
int lineNumber = 1;
clrscr();
[Link]("[Link]", ios::in);
if (!fin)
{
cout << "Error opening file!" << endl;
getch();
exit(1);
}
cout << lineNumber << ":";
while (![Link]())
{
[Link](ch);
if (ch != '\n')
{
cout << ch;
}
else
{
cout << endl;
if (![Link]())
{
lineNumber++;
cout << lineNumber << ":";
}
}
}
[Link]();
getch();
}