This program numbers the lines found in a text file. Write a
program that reads text from a file and outputs each line
preceded by a line number. Print the line number
right-adjusted in a field of 3 spaces. Follow the line
number with a colon, then one space, then the text of the
line. You should get a character at a time and write code to
ignore leading blanks on each line. You may assume that the
lines are short enough to fit within a line on the screen.
Otherwise, allow default printer or screen output behavior
if the line is too long (i.e., wrap or truncate). A somewhat
harder version determines the number of spaces needed in the
field for the line numbers by counting lines before
processing the lines of the file. This version of the
program should insert a new line after the last complete
word that will fit within a 72-character line.
No Answer is Posted For this Question
Be the First to Post Answer
Who invented oop?
different types of castings
Is data hiding and abstraction same?
what is difference between c++ language and java language
advantage and disadvantage in c++>>oops and what are the questions ask for interview in c++>>oops. could you tell me or reply me
suppose A is a base class and B is the derved class. Both have a method foo which is defined as a virtual method in the base class. You have a pointer of classs B and you typecast it to A. Now when you call pointer->foo, which method gets called? The next part of the question is, how does the compiler know which method to call?
How do you answer polymorphism?
i got a backdoor offer in process global,Bangalore..Can i work with it?
What is difference between function overloading and overriding?
explain defference between structure and class with example
what is virtual function?
What is the concept of object oriented program?