MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Impetus knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
int * ptr=(int *) realloc(NULL,100) is same as |
| A. | int *ptr=(int *) malloc(20) |
| B. | int *ptr=(int *) malloc(50) |
| C. | int *ptr=(int *) calloc(25,4) |
| D. | int *ptr=(int *) calloc(20,4) |
| Answer» D. int *ptr=(int *) calloc(20,4) | |
| 2. |
output of following program #include<stdio.h> int f1( int ); void main() { int b=5; printf("%d,%d", f1(b),f1(b)); } int f1(int b) { static int n=5; n++; return n; } |
| A. | 6,6 |
| B. | 6,7 |
| C. | 7,6 |
| D. | 5,6 |
| Answer» D. 5,6 | |
| 3. |
The effectiveness of an algorithm is best stated in |
| A. | Best-case Time |
| B. | Average-case Time |
| C. | Worst-Case running time |
| D. | Industry-Standard Time |
| Answer» D. Industry-Standard Time | |
| 4. |
Big O notation is defined for |
| A. | Time and Space Complexity |
| B. | Optimality |
| C. | Searching |
| D. | Sorting |
| Answer» B. Optimality | |
| 5. |
Iterators are________________ |
| A. | Generalised pointers in STL |
| B. | Container classes in STL |
| C. | Algorithms in STL |
| D. | Special Methods in STL |
| Answer» B. Container classes in STL | |
| 6. |
What happens when the following piece of code in file1.c, is compiled and executed? namespace { Class Temp { public: int GetVal() { return 100; } }; } //end of namespace int main() { Temp oTempObj1; Cout<<otempobj1.getval()<<endl; } </otempobj1.getval()<<endl; |
| A. | Compile Error |
| B. | 100 |
| C. | Runtime Error |
| D. | Compilation Error |
| Answer» C. Runtime Error | |