Unformatted text preview: 1.) [9 points] Give 3 reasons why it's important to comment your code. What are the 2 different ways to comment code in C++ and how are they different? It's important to comment your code because. .. 1. it makes easier for other people to understand your program. 2. it helps you while programming to organize and write your code. 3. it helps you track down and debug errors. The // comment style comments out any text on that line to the right of the slashes. The /* */ comment style comments out all code contained between the asterisks. 2.) [6 points] Write the output of the following segments of code. a.) int x = 3 cout << x << 2*x 36 b.) cout << "\"Hello\\\n Gandalf!" exactly the same. Wehve covered many topics in the last...
View Full Document
This essay was uploaded on 04/21/2008 for the course STATS 112 taught by Professor Esfandini during the Spring '08 term at UCLA.
- Spring '08