Computer Programming: Sample Questions
Computer Programming: Sample Questions
Computer Programming
a. 0 to 255
b. -128 to 127
c. -255 to 254
d. 0 to 509
a. 0
b. 1
c. -1
d. 10
3. Annie makes a program to print the product of cubes of the first 10 whole numbers. She writes the
following program
a. Iteration
b. Decision-making
c. Object Oriented Programming
d. Recursion
a. Differ by 80
b. Same
c. Differ by 50
d. Differ by 160
6. In which area of a class are data and function directly accessible outside the class?
a. Public
b. Private
c. Protected
d. None of these
7. Here is an infix notation ((A+B)*C-(D-E))^(F+G) Choose the correct postfix notation of the above from
the given options.
a. AB+CD*E--FG+^
b. AB+C*DE--FG+^
c. AB+C*DE-FG-+^
d. A+BC*DE-FG-+^
8. If the depth of a tree is 3 levels, then what is the size of the tree?
a. 2
b. 4
c. 6
d. 8
9. One of the following options is a form of access used to add and remove nodes from a queue.
a. LIFO
b. FIFO
c. Both LIFO and FIFO
d. None of these
10. What is the time complexity of adding three matrices of size NXN cell-by-cell?
a. O(N)
b. O(N^2)
c. O(N^3)
d. None of these