UNIT 2 2.4 Constants Flashcards

1
Q

refer to fixed values that may not be altered by the program. Turbo C constant
can be any of the basic data types or known as Literal Constants.

A

Constants

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

constants that are enclosed between single quotes.

A

Character constants

Example
‘a’, ‘%%’ , ‘P’ , ‘U’, ‘P’

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

constants that are specified as number without fractional components.

A

Integer Constants

Example
10, -100, 25, 3179

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

Constants that required the use of decimal point followed by the number’s
fractional components.

A

Floating-point constant
Example
11.123, 1.25, 5.00

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

constant consists of a phrase contained/enclosed within double quotes. These constants are used in printf statements to introduce text messages into a
program.

A

String constant or Literal string constant

Example
“PUP”, “BSIT”, “BSCS”

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

These constants are defined using a #
defined declaration at the beginning of the program. This declaration is introduced by the word #
defined follow by a constant name and its value.

A

Declared Constants

Example
# define total 100
# define orange 17.50
# define letter ‘M’
# define x 5
# define word “hello”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly