Chapter 2 Flashcards
(3 cards)
1
Q
How do I use the scientific command and what does it do?
A
- e.g cout «_space;” Height is “ «scientific«height«“cm.”;
- 1.750000e+002 means 1.75 x 10^2
2
Q
What is \n and endl?
A
- Both will create a new lines in the output stream. e.g cout «_space;“\nPlease enter your name\n”;
- The ‘\n’ must always be between quotes and therefore can also be embedded within the output text string.
3
Q
What are the main 3 variables?
A
- char (alphabet) : 1 byte
- int (whole numbers): 4 bytes
- double (real numbers) : 8 bytes