Convert the C program in the power.c file (Section 9.4.2) into C++. sore the pre-standard, post standard without namespaces and post standard with namespaces versions of the program in the files named power1.cpp power2.cpp power3.cpp. Generate the executable code for the three files and store the code in power1 power2 and power3 files respectively. Then run the three programs to see if they all work. Write down the sequence of commands.
First of all, the source code needs to be edited to generate the code for the three versions of the program. Any editor such as vim or vi can be used for this purpose. To compile the code instead of the gcc compiler, g++ compiler is used.
```
$ g++ power1.cpp -o power1
$ g++ power2.cpp -o power2
$ g++ power3.cpp -o power3
$ ./power1
$ ./power2
$ ./power3
$
```
Computer Science & Information Technology
You might also like to view...
MC Which type of databases store data in tables and define relationships between the tables?
a) tabular databases. b) relational databases. c) storage databases. d) None of above.
Computer Science & Information Technology
Each connection point on a network is referred to as a network ____________________.
Fill in the blank(s) with the appropriate word(s).
Computer Science & Information Technology