Chapter 2 Flashcards

(47 cards)

1
Q

C Year

A

1972

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Printf function

A

printing out (output)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

scanf

A

scans, recives input saves it into variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Preprocessor

A

modifies C program before compilation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Library?

A

collection of useful functions and symbols that can be accessed by program. ends with “.h”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

preprocessor directive

A

It’s the hashtad that indicates to the program that it is a preprocessor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Constant macro

A

Name replaced by a particular constant value before the program is sent to compiler (#define)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

C program’s main function?

A

int main() . marks the beginning of the function where the program begins.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Declarations?

A

Spot creted in the memory for the values with these names. depending on the data type, the amount of memory for the variable. Has to be initialized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Executable statements?

A

lines that are converted to machine language. Instructions executed by computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

REserved words?

A

words that have a special meaning in c, basically, they cant be used for any other things than the specific function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Standard identifier?

A

Reserved word but can be redefined (not recommended)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

User defined identifiers?

A

Names of memory cells that hold data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

User defined identifier rules

A
  1. must consist of letter, digits and underscores
  2. cannot begin with a digit
  3. A C reserved word cannot be used as identifier
  4. An identifier in C standard library should not be redefined
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Variable?

A

name associated with a memory cell whose value can change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Variable declarations?

A

Statements that comunicate to the compiler the name and data type of variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Executable statementes

A

Follow declarations in a function and turne into machine language. used to code the algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Input operation

A

instruction that copies data from an input into a memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Output operation

A

an instruction that displays information stored in memory

20
Q

Input/output function

A

function that preforms an input output operation (T_T)

21
Q

Function call

A

calling or activating a function

22
Q

function argument

A

Part of a function enclosed in parenthesis

23
Q

% data types

A

%f: double or float printf, %f scanf
%d int
%c char

24
Q

for print f, what part of the argument will be printed

25
What is the return statemendt
Transfers cotnrol from program to operating system (value 0 is optional)
26
Why is program style important?
it is theoretically possible to write the C program in one line, but that is not easy to read. Style is important because of readability
27
Why are comments useful?
They also enhance readability
28
What are the data types of an expression
Mixed type expression, mixed type assignment, type cast
29
What are mixed-type data expressions
Has operands of differet types
30
mixed type assignment?
The expression is being evaluated and the variable to which it is assigned have different data types
31
type cast
Converting an expression to a different type by writing the desired type in parenthesis in form of the expression
32
Unary operator
One operator with one operand i.e. x = -y from right to left
33
Binary operator
Operatorr with two operands i.e. x = y + z from left to right
34
Rules for evaluating expressions
PEMDAS
35
Numerical inaccuracies
representational error, cancellation error, arithmetic underflow, arithmetic overflow
36
representational error
due to coding real number as finite number of binary digits
37
cancellation error
applying arithmetic operation to operands of drastically different magnitudes
38
arithmetic underflow
error which a small computational number shows up as 0
39
arithmetic overflow
error that is an attemptt o represent a result that it too largee
40
field width
number of columns used to display a value
41
When using doubles, what needs to be specified?
total field width (number of decimal places desired)
42
Interactive mode?
mode of program execution in which the user responds to prompts by entering data
43
batch mode
mode of program execution in which the program cans its data from a previously prepared data file
44
debugging
removing errors from programs
45
Syntax error
violation of the C grammar rules(detected while compiling)
46
Run time error
attempt to perform an invalid opeeration
47
Logic errors
An error cause by follwoing an incorrect algorithm