PROGRAMING AND PROBLEM SOLVING
QUIZ
1) Which loop is faster in C Language, for, while, or Do While?
a) For
b) while
c) do-while
d) All work at the same speed control structure?
2) Which among the following is an unconditional control structure?
a) Do-while
b) If-else
c) Goto
d) For
3) What is the output of this program?
int main(){
Int a[]= \{1, 2\}
int b[4] = \{1, 2, 3, 4\}
printf("%d \% d ^ 1 prime , a[0], b[0] ) ;
};
a) 12
b) 13
c) 22
d) 11
4) What is the index number of the last element of an array with 29 elements?
a) 29
b) 28
c) 0
d) Programmer-defined
5) Which of the following correctly accesses the seventh element stored in A, an array
with 100 elements?
a) A[6]