Basic Syntax of C Flashcards

1
Q

Ignored by the C compiler

A

Comment

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

Used to document programs

A

Comment

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

Improve readability

A

Comment

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

Syntax for one-line comment
Syntax for multi-line comments

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

Lines beginning with # are processed by the

A

preprocessor before compilation

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

Preprocessor Directive tells the preprocessor to include

A

<stdio.h>

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

What does the <stdio.h> stand for?

A

Name of the standard library declaration file for all STandard Input and Output functions

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

Where does every C programs begins execute?

A

Function main

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

What function must contain in a C program?

A

main

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

What does void mean?

A

function main does not receive any information

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

What the function main will perform

A

Program Statements

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

Syntax of Program Statements

A

enclosing a block of program statements of the function within {}

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

How can statements terminate

A

Statements are terminated with a semicolon ;

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

What does the program statement do?

A

Instructs the computer to perform an action.

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

Syntax for variable declaration

A

data type variable_list;

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

All variables must be declared with _ before they can be used

A

name and data type

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

% indicates that

A

a variable’s value is to be printed, followed by a character representing it’s data type

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

What to use when printing a statement?

A

printf

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

What to use when scanning user input?

A

scanf

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

What is f in scanf?

21
Q

Used to obtain a value from the user

22
Q

Syntax of scanf

A

scanf(“%format control string”, &address operator)

23
Q

Symbolic names is also known as

A

Variable Names

24
Q

assign symbolic names, known as
variable names, for storing program computations and results

25
Variable names can only start with
letter or underscore
26
Is C case-sensitive?
Yes
27
giving values in variables is called
assignment
28
values are called
constants
29
set name of variable along with the datatype of value that it will store
Declaration
30
assign value to the variable as per its type
Definition
31
Types of data types
Integers, Floating, Character
32
Used for declaring integer variable
Integral Types
33
Integral type keyword
int
34
Character type keyword
char
35
Floating points keyword
float or double
36
Can hold real numbers and values that contain a decimal point
Floating Points
37
Difference between float and double in terms of places
float - 6 decimal places double - 15 decimal places
38
Difference between float and double in terms of storage
float - 4 byte double - 8 byte
39
Modifiers of real numbers (floating-point)
float, double, long double
40
Modifiers of whole numbers (integer)
short, int, long
41
Syntax for modifiers/qualifiers
optional_modifier datatype variable_list;
42
integer declaration syntax
`int id;`
43
Extended ASCII has __ codes
256
44
Alter the meaning of base data types to yield a new data type.
Modifiers/Qualifiers
45
Used to distinguish signed and unsigned integers.
Modifiers/Qualifiers
46
unsigned modifier means
variable cannot hold negative values.
47
signed modifier means
a variable can hold both positive and negative values.
48
size of modifier double
8 bytes
49
size of modifier long
10 bytes