Given the enumeration definition above, what is the value of saturday?
17
New cards
false
Two enum names cannot have same value
18
New cards
false
enum state {working, failed};
enum result {failed, passed};
If the above enumerations are in the same scope, this source code would compile with no errors
19
New cards
Repeats a statement or group of statements while a given condition is true, can execute 0...n times
while loop
20
New cards
Allows you to efficiently write a loop that needs to execute a specific number of times; a valid implementation may only include two semicolons
for loop
21
New cards
Is guaranteed to execute at least one time
do...while loop
22
New cards
one or more loops inside any other while, for, or do...while loop
nested loops
23
New cards
Terminates the loop or switch statement and transfers execution to the statement immediately following the loop or switch
break
24
New cards
Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating
continue
25
New cards
Transfers control to the labeled statement
goto
26
New cards
true
All arrays consist of contiguous memory locations
27
New cards
true
A specific element in an array is accessed by an index
28
New cards
- sequential elements - same data type - fixed size
Which of the following are true regarding arrays. Select all that apply.
29
New cards
[]
What punctuation is used to declare the explicit size of an array upon declaration when the array is not initialized during declaration?
30
New cards
true
All arrays have 0 as the index of their first element which is also called the base index
31
New cards
[][][]
If an array is a three-dimensional array, how many sets of square brackets are used to identify each element of the array?
32
New cards
void myFunction(int param[10]);
Formal parameters as a sized array
33
New cards
void myFunction(int *param);
Formal parameters as a pointer
34
New cards
void myFunction(int param[]);
Formal parameters as an unsized array
35
New cards
int * myFunction()
Which of the following is the only methodology to return an array from a function in the C programming language?
36
New cards
true
The scandalous truth is that C has no arrays — that they are merely cleverly disguised pointers
37
New cards
true
A program can have same name for local and global variables but the value of local variable inside a function will take preference.
38
New cards
Inside a function or block
local
39
New cards
outside of all functions
global
40
New cards
in the definition of function parameters
formal parameters
41
New cards
true
The C Preprocessor is not a part of the compiler, but is a separate step in the compilation process
42
New cards
#
All preprocessor commands begin with what symbol?
43
New cards
true
A preprocessor command must be the first nonblank character.
44
New cards
Used for constants to increase readability
#define
45
New cards
inserts a particular header from another file
#include
46
New cards
undefines a preprocessor macro
#undef
47
New cards
Returns true if this macro is defined
#ifdef
48
New cards
tests if a compile time condition is true
#if
49
New cards
The alternative for #if
#else
50
New cards
#else and #if in one statement
#elif
51
New cards
ends preprocessor conditional
#endif
52
New cards
Prints error message on stderr
#error
53
New cards
Issues special commands to the compiler
#pragma
54
New cards
The current date as a character literal in "MMM DD YYYY" format
_DATE_
55
New cards
The current time as a character literal in "HH:MM:SS" format
_TIME_
56
New cards
This contains the current filename as a string literal
_FILE_
57
New cards
This contains the current line number as a decimal constant
_LINE_
58
New cards
defined as 1 when the compiler compiles with the ANSI standard
_STDC_
59
New cards
A macro is normally confined to a single line, however when multiple lines are required use this operator
The C preprocessor offers operators to help create macros. Match the operator to its behavior
\
60
New cards
Converts a macro parameter into a string constant
The C preprocessor offers operators to help create macros. Match the operator to its behavior
#
61
New cards
It permits two separate tokens in the macro definition to be joined into a single token
The C preprocessor offers operators to help create macros. Match the operator to its behavior
##
62
New cards
true
Type casting is a way to convert a variable from one data type to another data type
63
New cards
(type_name) expression
Which of the following is an example of using the cast operator?
64
New cards
true
It is considered good programming practice to use the cast operator whenever type conversions are necessary
65
New cards
true
void integerPromotion() {int i = 17;char c = 'c';int sum; sum = i + c;printf("Value of sum : %d\n", sum );}
Given the C data types and the concept of integer promotion, the above source code would compile and run without errors.
66
New cards
true
The usual arithmetic conversions are not performed for the assignment operators, nor for the logical operators && and ||
67
New cards
- visibility - life time - scope
What does a storage class define regarding variables?
68
New cards
is the default storage class for all local variables
Match the storage class to its definition
auto
69
New cards
To define local variables that should be stored in register instead of RAM
Match the storage class to its definition.
register
70
New cards
Instructs the compiler to keep a local variable in existence during the life-time of the program
Match the storage class to its definition.
static
71
New cards
To give a reference of a global variable that is visible to ALL the program files
Match the storage class to its definition.
extern
72
New cards
adds two operands
Match the operator to its functionality
+
73
New cards
Multiplies two operands
Match the operator to its functionality
*
74
New cards
remainder after integer division
Match the operator to its functionality
%
75
New cards
Decrements integer by one
Match the operator to its functionality
--
76
New cards
Checks if two operands are equal
Match the operator to its functionality
==
77
New cards
checks if left operand is greater than or equal to right operand
Match the operator to its functionality
>=
78
New cards
checks if two operands are not equal
Match the operator to its functionality
!=
79
New cards
used to reverse the logical state of its operand
Match the operator to its functionality
!
80
New cards
If any of the two operands are non-zero, then the condition becomes true
Match the operator to its functionality
||
81
New cards
Bitwise and
Match the operator to its functionality&
82
New cards
Assigns values from the right side operand to the left side operand
Match the operator to its functionality
=
83
New cards
It divides the left operand by the right operand and assigns the value to the left operand
Match the operator to its functionality
/=
84
New cards
returns the size of a variable
Match the operator to its functionality
sizeof()
85
New cards
Conditional expression; If condition is true ? then value X : otherwise value Y
Match the operator to its functionality
?=
86
New cards
It subtracts the right operand from the left operand and assigns the value to the left operand
Match the operator to its functionality
-=
87
New cards
true
C programming language assumes any non-zero and non-null values as true
88
New cards
true
C programming language assumes any zero or null values as false
89
New cards
a is less than 20
int a = 10; if( a < 20 ){printf("a is less than 20\n" );}
Given the source code above, what would output to the command prompt or terminal as a result of the if condition?
90
New cards
a is not less than 20
int a = 30; if( a < 20 ) {printf("a is less than 20\n" );} else {printf("a is not less than 20\n" );}
Given the source code above, what would output to the command prompt or terminal window?
91
New cards
Value of a is 30
int a = 30; if( a == 10 ){printf("Value of a is 10\n" );}else if( a == 20 ){printf("Value of a is 20\n" );}else if( a == 30 ){printf("Value of a is 30\n" );}
Given the source code above, what would output to the command prompt or terminal window?
92
New cards
all of these
Which of the following is branching statement of C language?
93
New cards
switch
____________ is the built in multiway decision statement in C
94
New cards
false
A program stops its execution when break statement is encountered.