Chapter 2 Flashcards

(3 cards)

1
Q

How do I use the scientific command and what does it do?

A
  • e.g cout &laquo_space;” Height is “ «scientific«height«“cm.”;
  • 1.750000e+002 means 1.75 x 10^2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is \n and endl?

A
  • Both will create a new lines in the output stream. e.g cout &laquo_space;“\nPlease enter your name\n”;
  • The ‘\n’ must always be between quotes and therefore can also be embedded within the output text string.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the main 3 variables?

A
  • char (alphabet) : 1 byte
  • int (whole numbers): 4 bytes
  • double (real numbers) : 8 bytes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly