Variables Flashcards

1
Q

Which of the following is true regarding a variable in C?

A
  • has a specific type
  • the data type determines the size of the variable
  • the data type determines the set of operations that can be applied to the variable
  • the data type determines the range of values that can be stored
  • the data type determines the layout of the variable’s memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Char

A

Typically one byte and is an integer type

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

Int

A

the most natural size of integer for the machine

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

Float

A

A single precision floating point value

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

Double

A

A double-precision floating point value

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

Void

A

Represents the absence of type

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

A variable definition must include as a minimum which of the following? Select all that apply.

int variableName = 53;

A

Semi-colin
Data type
Valid name

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

Which of the following is true regarding variable definition in C? Select all that apply.

A
  • has its meaning at the time of compilation only
  • is useful when you are using multiple files
  • provides assurance to the compiler that there exists a variable with the given type and name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly