C Programming: MCQ Set – 09
C Programming: MCQ Set – 09
by
codecrucks
·
Published
· Updated
Q81: The name of all functions end with a
- (A) Pair of parenthesis
- (B) Semicolon
- (C) Braces
- (D) Colon
- (A) Monitor
- (B) Function
- (C) Program
- (D) Structure
Q83: The keyword used to transfer control from a function back to the calling function is
- (A) Switch
- (B) Goto
- (C) Go back
- (D) Return
Q84: What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
- (A) The element will be set to 0.
- (B) The compiler would report an error.
- (C) The program may crash if some important data gets overwritten.
- (D) The array size would appropriately grow.
Q85: Consider the following recursive C function that takes two arguments. What is value of function foo when it called as foo(512, 2)?
unsigned int foo(unsigned int n,unsigned int r)
{
if(n>0)
return((n%r)+foo(n/r,r));
else
return 0;
}
Q86: Consider the following recursive C function that takes two arguments. What is value of function foo when it called as foo(342, 10)?
unsigned int foo(unsigned int n,unsigned int r)
{
if(n>0)
return((n%r)+foo(n/r,r));
else
return 0;
}
- (A) 11
- (B) 12
- (C) 3
- (D) 6
Q87: Which of the following is a bad example of recursion ?
- (A) Factorial
- (B) Fibonacci numbers
- (C) Tower of Hanai
- (D) Tree traversal
Q88: Recursion is sometimes called
- (A) Circular definition
- (B) Complex definition
- (C) Procedure
- (D) Union
Q89: The data structure needed to convert a recursion to an iterative procedure is
- (A) Queue
- (B) Graph
- (C) Stack
- (D) Tree
Q90: Which of the following data structure is linear type ?
- (A) Strings
- (B) Lists
- (C) Queues
- (D) All of the above
Answer:
Question | Q81 | Q82 | Q83 | Q84 | Q85 | Q86 | Q87 | Q88 | Q89 | Q90 |
Answer | A | B | D | C | B | B | B | A | C | D |