Basic Syntax Flashcards

1
Q

Given the source code below, how many tokens make up the statement?

printf(“Hello COP 3223!”);

A

5

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

In a C program, an individual statement must be ended with a semicolon.

A

True

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

There are multiple formats of an acceptable comment in C, select all that apply.

A
  • /* comment */

- // comment

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

Regarding identifiers for variables, functions, or any other user-defined item, which of the following are acceptable? Select all that apply.

A

_variable
variable
VARIABLE
var23iable

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

Regarding keywords in the C programming language and creating identifiers. Keywords are reserved in all lowercase AND all uppercase.

A

False

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

Regarding whitespace in the C programming language, spaces are required between the operators in the following source code in order to compile, run, and provide the correct output.

int sum=2+3/2-12*15;

A

False

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