Fundamental Programming MCQs

100 MCQs  (Page 6 of 10)

Which loop is described as 'entry-controlled'?
Every loop in C
while loop
repeat-until loop
do-while loop
Which declaration of default arguments is valid in C++?
void f(int a, int b = 2, int c);
void f(int a, int b = 2, int c = 3);
void f(int a = 1, int b, int c);
void f(int a = 1, int b, int c = 3);
Can two C++ functions be overloaded if they differ only in their return type, as in int f(int) and double f(int)?
Yes, but only for virtual functions
Yes, the compiler picks one based on the assignment target
No, it is a compilation error
Yes, if both are inline