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?

A

formatted

21
Q

Used to obtain a value from the user

A

scanf

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

A

Variables

25
Q

Variable names can only start with

A

letter or underscore

26
Q

Is C case-sensitive?

A

Yes

27
Q

giving values in variables is called

A

assignment

28
Q

values are called

A

constants

29
Q

set name of variable along with the datatype of value that it will store

A

Declaration

30
Q

assign value to the variable as per its type

A

Definition

31
Q

Types of data types

A

Integers, Floating, Character

32
Q

Used for declaring integer variable

A

Integral Types

33
Q

Integral type keyword

A

int

34
Q

Character type keyword

A

char

35
Q

Floating points keyword

A

float or double

36
Q

Can hold real numbers and values that contain a decimal point

A

Floating Points

37
Q

Difference between float and double in terms of places

A

float - 6 decimal places
double - 15 decimal places

38
Q

Difference between float and double in terms of storage

A

float - 4 byte
double - 8 byte

39
Q

Modifiers of real numbers (floating-point)

A

float, double, long double

40
Q

Modifiers of whole numbers (integer)

A

short, int, long

41
Q

Syntax for modifiers/qualifiers

A

optional_modifier datatype variable_list;

42
Q

integer declaration syntax

A

int id;

43
Q

Extended ASCII has __ codes

A

256

44
Q

Alter the meaning of base data types to yield a new data type.

A

Modifiers/Qualifiers

45
Q

Used to distinguish signed and unsigned integers.

A

Modifiers/Qualifiers

46
Q

unsigned modifier means

A

variable cannot hold negative values.

47
Q

signed modifier means

A

a variable can hold both positive and negative values.

48
Q

size of modifier double

A

8 bytes

49
Q

size of modifier long

A

10 bytes