1.
Which mathematical operators are in the correct order ?
Ans:
Addition,
Division, Modulus
Division,
Multiplication, Modulus
Modulus,
Multiplication, Subtraction
Modulus,
Addition, Division
2.
Which of the following are NOT relational operators ?
Ans:
<=
==
<
>
3.
The first expression in a for loop is ?
Ans:
The test
expression.
The step
value of the loop.
The value
of our counter variable.
None of
the above.
4.
What is the break statement used for ?
Ans:
To quit
the program.
To quit
the current iteration.
To stop
the current iteration and begin the next iteration.
None of
the above.
5.
What is the continue statement used for ?
Ans:
To
continue to the next line of code.
To stop
the current iteration and begin the next iteration from the beginning.
As an
alternative to the else statement.
None of
the above.
6.
A function prototypes are useful
Ans:
Because
they tell the compiler that a function is declared later.
Because
they make the program more readable..
Because
they allow the programmer to see a quick list of functions in the program along
with the arguments for each function.
All of the
above.
7.
Because of variable scope
Ans:
Variables
created in a function cannot be used another function.
Variables
created in a function can be used in another function.
Variables
created in a function can only be used in the main function
None of
the above.
8.
Which symbol is used to reference a pointer ?
Ans:
*
&
@
$
9.
Adding to a pointer that points to an array will
Ans:
Cause an
error.
Increase
the value of the element that the pointer is pointing to.
Cause the
pointer to point to the next element in the array.
None of
the above.
10.
To access the members of a structure, which symbol is used ?
Ans:
*
->
.
,
11.
A member is a
Ans:
Variable
in a structure.
Structure's
datatype.
Pointer to
a structure.
None of
the above.
12.
Structures can...
Ans:
Hold many
variables of different types.
Have
pointers to structures.
Be
assigned to one another, given they are the same type.
All of the
above.
13.
In a C program, the first statement that will be executed is:
Ans:
The first
executable statement of the program.
The first
executable statement of the main() function.
The first
executable statement after the comment /*start here*/
The first executable
statement of the end function.
14.
The statement: int *jack
Ans:
Declares
that all variables ending with jack are ints.
Is a
pointer declaration. jack is a pointer to an int variable.
Declares
that jack is the address of a variable and that the address is an int.
Declares
that all variables starting with jack are ints.
15.
The preprocessor directives begins with the symbol
Ans:
#
&
*
@
Correct
Answers:
1.
Modulus, Multiplication, Subtraction
2.
==
3.
The value of our counter variable.
4.
To quit the current iteration.
5.
To stop the current iteration and
begin the next iteration from the beginning.
6.
All of the above.
7.
Variables created in a function
cannot be used another function.
8.
&
9.
Cause the pointer to point to the
next element in the array.
10.
.(dot)
11. Variable in a structure.
12.
All of the above.
13.
The first executable statement of
the main() function.
14.
Is a pointer declaration. jack is a
pointer to an int variable.
15.
#
No comments:
Post a Comment