Cn Flashcards

(13 cards)

1
Q

What are keywords in C?

A

Predefined words with specific meanings in C compilers that cannot be used as identifiers

Examples include auto, break, default, do, extern, float, long, register, struct, for.

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

What is an identifier in C?

A

Names given by the user to program elements like variables, functions, and arrays

Identifiers must follow specific naming rules.

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

What is the first rule for naming identifiers in C?

A

The first character must be an alphabet or an underscore.

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

What characters can be used in identifiers?

A

Only letters, digits, or underscores.

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

Can keywords be used as identifiers?

A

No, keywords cannot be used as identifiers.

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

What is the maximum length of identifiers in C?

A

Identifiers should not be greater than 31 characters.

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

Can identifiers contain whitespace?

A

No, identifiers must not contain whitespace.

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

What are the most common functions for input and output operations in C?

A

scanf and printf.

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

Which library includes the printf and scanf functions?

A

stdio.h.

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

What is the purpose of the printf function?

A

To display formatted output to the console.

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

What is the syntax of the printf function?

A

printf(“format string”, argument1, argument2, …);

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

What does the format string in printf specify?

A

How the output should be formatted.

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

What are the arguments in the printf function?

A

Variables or constants whose values are to be printed.

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