Friday, July 24, 2009

C Objective type

Previous Next

A function prototypes are useful

a) Because they tell the compiler that a function is declared later.

b) Because they make the program more readable..

c) Because they allow the programmer to see a quick list of functions in the program along with the arguments for each function.

d) All of the above.

Answer is :D


Because of variable scope

a) Variables created in a function cannot be used another function.

b) Variables created in a function can be used in another function.

c) Variables created in a function can only be used in the main function

d) None of the above.

Answer is :A


Which symbol is used to declare a pointer ?

a) &

b) @

c)

*d) $

Answer is :C


Which symbol is used to reference a pointer ?
a) *
b) &
c) @
d) $
Answer is :B


Adding to a pointer that points to an array will
a) Cause an error.
b) Increase the value of the element that the pointer is pointing to.
c) Cause the pointer to point to the next element in the array.
d) None of the above.
Answer is :C


To access the members of a structure, which symbol is used ?
a) *
b) -
c) ,
d) .

Answer is : D


A member is a
a) Variable in a structure.
b) Structure's datatype.
c) Pointer to a structure.
d) None of the above.
Answer is :A


Structures can...
a) Hold many variables of different types.
b) Have pointers to structures.
c) Be assigned to one another, given they are the same type.
d) All of the above.
Answer is :D


In a C program, the first statement that will be executed is:a) The first executable statement of the program.
b) The first executable statement of the main() function.
c) The first executable statement after the comment /*start here*/
d) The first executable statement of the end function.
Answer is :B


The statement: int *jack

a) Declares that all variables ending with jack are ints.
b) Is a pointer declaration. jack is a pointer to an int variable.
c) Declares that jack is the address of a variable and that the address is an int.

d) Declares that all variables starting with jack are ints.
Answer is :B

Previous Next

No comments:

Post a Comment