Constants and Operators Flashcards

1
Q

refer to fixed values that the program may not alter during its
execution

A

Constants

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

fixed values

A

Literals

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

Constants may belong to

A

any of the data type

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

basic data types

A

integer constant
floating-point constant
character constant or a string literal
enumeration constant (enum)

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

Two data types that must have at least one digit

A

Integer and Floating Point Constants

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

A data type that must not have a decimal point

A

Integer Constants

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

Two data types that can either be positive or negative

A

Integer and Floating Point Constants

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

No commas or blanks are allowed within __

A

Integer Constant and Real Constant

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

If no sign precedes an integer constant, then

A

it is assumed to be positive.

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

An integer constant is assumed to be positive if

A

no sign precedes an integer constant

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

The allowable range for integer constants is

A

-32768 to 32767

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

A data type that must have a decimal point

A

Floating Point Constants

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

You can represent floating point literals either

A

decimal form or
exponential form

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

A floating-point literal has

A

integer part
decimal point
fractional part
exponent part

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

A single alphabet, a single digit or a single special symbol enclosed within single quotes

A

Character Constants

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

The maximum length of a character constant is

A

1 character

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

Enclosed within double quotes

A

String Constants

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

Contains characters that are similar to character literals:

A

plain character
escape sequences

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

Two ways of defining constants

A

Using #define preprocessor
Using const keyword

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

Syntax of #define preprocessor

A

define IDENTIFIER value

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

Syntax of const keyword

A

const type variable = value;

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

Something that acts on a variable or an expression

A

Operators

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

Operators does

A

computes or retrieves a value
changes an object

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

The symbols which are used to perform logical and mathematical
operations in a C program

A

Operators

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

Join individual constants and variables to form expressions

A

Operators

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

Operators are used to perform _ and _ operations in a C program

A

logical and mathematical

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

Expressions can be _

A

nested

28
Q

Types of Operators

A

Arithmetic operators
Assignment operators
Increment/decrement operators
Relational operators
Logical operators
Conditional operators (ternary operators)
Special operators

29
Q

Operators that perform +, -, *, /

A

Arithmetic Operators

30
Q

require one operand

A

Unary

31
Q

require two operands

A

Binary

32
Q

% requires _ operands

A

integer

33
Q

The / can produce surprising results. When both of the operands are int, the result

A

truncated

34
Q

Operator Precedence

A
Highest + - (unary)
* / %
Lowest + - (binary)
35
Q

Left Associative

A

* / % + -

36
Q

Right Associative

A

unary operators ( + - )

37
Q

The = operator is _ associative

A

right associative

38
Q

Can have a value assigned to them

A

Lvalues

39
Q

Placed on the left side of an equal sign

A

Lvalues

40
Q

Compound Assignment Operators Associativity

A

right associative

41
Q

Increment and Decrement Operators

A

++ (increment)
– (decrement)

42
Q

used to increase the value of the variable by one

A

Increment operators (i++, ++i)

43
Q

used to decrease the value of the variable by on

A

Decrement operators(i–, –i)

43
Q

used to decrease the value of the variable by on

A

Decrement operators(i–, –i)

44
Q

Value of expression is an incremented/decremented value

A

++i;

45
Q

Value of expression is the original value, before it was modified

A

i++

46
Q

All binary operators → taking 2 operands

A

Relational Operators

47
Q

If the relation is true, it returns

A

1

48
Q

If the relation is false, it returns

A

0

49
Q

Used to compare values, usually in making decisions

A

Relational Operators

50
Q

Relational Operators Precedence

A

Arithmetic operators have higher priority than relational operators

51
Q

Relational Operators Associativity

A

The relational operators are left associative

52
Q

Equality Operators (equal to)

A

==

53
Q

Equality Operators (not equal to)

A

!=

54
Q

Equality Operators Associativity

A

Left associative

55
Q

Equality Operators produce

A

True (1) or False (0)

56
Q

Equality Operators Precedence

A

lower precedence than relational operators

57
Q

Logical operators

A

&& || !

58
Q

used when more than one conditions are to be tested and based on that
result, decisions have to be made

A

Logical Operators

59
Q

Logical AND

A

&&

60
Q

Logical OR

A

||

61
Q

Logical NOT

A

!

62
Q

Logical NOT

A

!

63
Q

Logical NOT

A

!

64
Q

Logical NOT

A

!