Multiple Choice Questions 1
Which of the following is a legal identifier:
1world
this_is_legal
this_isn't_legal
None of the above are legal identifiers.
White space may occur in any of the following places
except
Before and after an operator.
Within a string constant.
Between the letters of an identifier.
Between a function and the left parenthesis.
White space
must
be used
Before a semicolon.
Following a unary operator.
Before and after a binary operator.
Between a data type name and a variable name in a declaration.
Which of the following is
not
a keyword:
while
printf
int
All of the above are keywords.
Which of the following is a legal integer constant:
10.1
1,000
1.5e12
None of the above are integer constants.
What is the value of the expression 6 + 3 * 4?
18
36
54
The actual value is machine-dependent and may vary from system to system.
What is the value of the expression 16 / 3 % 3 ?
0
1
2
The expression will generate an error.
What is the value of the expression 5 * (3 + 2) ++ ?
26
25
30
The expression will generate and error.
Which of the following expression has the value 0 if and only if the value of N is divisible by 20 ?
N / 20
N % 20
20 % N
(N / 20) - (N % 20)
Which of the following is a valid string constant ?
'I am the string'
"No, I'm the string"
"I say, "I am the string", and I am."
All of the above are valid string constants.
Visited
times since 26 Aug 1998.