Chapter 2 Flashcards

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

A

””

25
Q

What is the return statemendt

A

Transfers cotnrol from program to operating system (value 0 is optional)

26
Q

Why is program style important?

A

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
Q

Why are comments useful?

A

They also enhance readability

28
Q

What are the data types of an expression

A

Mixed type expression, mixed type assignment, type cast

29
Q

What are mixed-type data expressions

A

Has operands of differet types

30
Q

mixed type assignment?

A

The expression is being evaluated and the variable to which it is assigned have different data types

31
Q

type cast

A

Converting an expression to a different type by writing the desired type in parenthesis in form of the expression

32
Q

Unary operator

A

One operator with one operand i.e. x = -y from right to left

33
Q

Binary operator

A

Operatorr with two operands i.e. x = y + z from left to right

34
Q

Rules for evaluating expressions

A

PEMDAS

35
Q

Numerical inaccuracies

A

representational error, cancellation error, arithmetic underflow, arithmetic overflow

36
Q

representational error

A

due to coding real number as finite number of binary digits

37
Q

cancellation error

A

applying arithmetic operation to operands of drastically different magnitudes

38
Q

arithmetic underflow

A

error which a small computational number shows up as 0

39
Q

arithmetic overflow

A

error that is an attemptt o represent a result that it too largee

40
Q

field width

A

number of columns used to display a value

41
Q

When using doubles, what needs to be specified?

A

total field width (number of decimal places desired)

42
Q

Interactive mode?

A

mode of program execution in which the user responds to prompts by entering data

43
Q

batch mode

A

mode of program execution in which the program cans its data from a previously prepared data file

44
Q

debugging

A

removing errors from programs

45
Q

Syntax error

A

violation of the C grammar rules(detected while compiling)

46
Q

Run time error

A

attempt to perform an invalid opeeration

47
Q

Logic errors

A

An error cause by follwoing an incorrect algorithm