Question: Create a program that reads the lines of a file called code.cpp and assign a line number to each line in the order you read
Create a program that reads the lines of a file called "code.cpp" and assign a line number to each line in the order you read it. The lines should then be printed out in reverse order but the line numbers should remain the in the same order.

Sample Output:
0: } 1: cout > c; 5: cin >> b; 6: cin >> a; 7: 8: double a, b, c; 9: int main(int argc, char *argv[]) { 10: 11: using namespace std; 12: #include
filereverse Microsot visual C+2010 Express File Edit inw Praject Debug Taals Windew selution Lcalorer filereversecpp Urknown Scape) Solutcn 'tilereverse 1 project) #1nclude io stream > a include aLh. h> using nanespace std; filereverse Hcoder Filcs int nainint arg char 1 double a, b, ci targetver.h Resource Hiles 1,Sourco Files cin a; cin b cin ; stelafx.cpp ReadMetxt cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
