Chapter 1: A tutorial introduction Flashcards
delaration
A declaration announces the properties of variables; it consists of a name and a list of variables.
ex:
int fahr, celcius;
int lower, upper, step;
type int
the variable is an integer. Its size depends on the machine. Commonly 16-bit ints (between -32768 and +32767) or 32-bit (between -10^38 and + 10^38)
type float
floating point i.e. numbers that may have a fractional part. Also depends on the machine you are using.
type char
character - a single byte
type short
short integer
type long
long integer
double
double-precision floating point.
%d
print as decimal integer
%6d
print as decimal integer, at least 6 characters wide
%f
print as floating point.
%6f
print as floating point, at least 6 characters wide
%.2f
print as floating point, 2 characters after the decimal point
%6.2f
print as floating point at least 6 characters wide and 2 after decimal point
define
defines a symbolic name or a symbolic constant to be a particular string of characters.
text stream
a sequence of characters divided into lines; each line consists of zero or more characters followed by a newline character.