Week 1 Flashcards
(81 cards)
For a file containing source code in the C language it’s name ends how?
test.c
What does return 1; mean?
There was some problem with the execution of the function.
An instruction list (IL) is a…
…complete set of well-known commands.
Which words cannot be used to name variables?
Reserved keywords, unless their case is changed (int - no, Int - yes).
The binary system is the system computers use to …
… store numbers.
What types of numbers do modern computers handle?
- integers
- floating-point numbers (or floats) that can be fractional
What is the best book about C programming ever written?
“The C Programming Language” by Dennis Ritchie and Brian Kernighan, also called “Kernighan-Ritchie”
What is the algorithm for a simple program which is only to display a certain text on the screen?
1) start
2) write text
3) stop
What rules exist with regards to the name of variables?
- only upper-case or lower-case Latin letters, digits and the character _ (underscore) are allowed
- variable name must begin with a letter
- the underline character is a letter
- upper- and lower-case letters are treated as different (Alice is not ALICE)
What is the new value if the variable Result?
Result = 100 + 200
300
What does int main(void) mean?
- result of function: an integer value
- name of function: main
- parameters: no parameters required
The characteristic of a number which determines its kind, range and application is called a …
…type.
What does a compiler do with statements in quotes?
They are considered string and ignored. They only look like part of the source code.
Each instruction in C must end with a…
…semicolon.
Is ‘_Exchange’ a valid variable name?
yes
The changes the preprocessor introduces are controlled entirely by its …
directives.
What does the include preprocessor directive do?
It replaces the directive with the content of the file whose name is listed in the directive.
How do compilers treat nested comments?
/* int k; /* int m; */ int z; */
Either they ignore the whole comment in it’s entirety or they treat part of it as variable and the rest will be invalid. Beware!
A computer only responds to a predetermined…
…set of commands.
What is the interior of a function called?
body
Computer programming is the act of…
…composing selected commands (instructions) in the proper order so that a desired effect is produced.
What does a compiler do if the source code is split over several files?
There are 2 phases - a compilation and a linking phase. It translates the source files into machine language and a linker then links these files into a single executable file.
Programs written in high-level languages can be translated into any number of different machine languages and run on different computers. What is this feature called?
portability
A program we write will not run or produce acceptable results unless it is correct in these 3 ways…
…lexically, syntactically and semantically.