Structured_Programming_Exam_New
Structured_Programming_Exam_New
2. Which of the following loops is used when the number of iterations is fixed?
6. What will happen if you access an array index out of bounds in C++?
A. & B. * C. -> D. .
A. 7 B. 8 C. 10 D. 9
A. const int x = 10; B. constant int x = 10; C. define const int x = 10; D. immutable int x = 10;
A. Ends the program B. Skips the current iteration C. Exits the loop D. Pauses execution
A. function func(); B. void func(); C. declare void func(); D. def void func();
A. A function calling another function B. A function calling itself C. A loop within a function D.
Nested functions
A. Length of an array B. Size of a data type in bytes C. Size of the program D. Number of
variables
A. Deallocates memory pointed by ptr B. Deletes ptr from memory C. Deletes all variables D.
Creates a pointer
20. Which type of loop checks the condition after executing the loop body?
A. End a loop B. Skip to the next iteration C. Restart the loop D. End the program
22. How do you define a function that does not return a value?
A. -> B. * C. . D. &
A. int func(int x); B. int func(int &x); C. int func(int *x); D. int func(x);
A. int arr = new int[10]; B. int *arr = new int[10]; C. int arr[10]; D. new int arr[10];
pointer type
To allocate memory
A. int arr[2, 3]; B. int arr[2][3]; C. int arr(2, 3); D. int arr[2][3][];
A. The ability of a function to take multiple forms B. A type of loop C. A pointer operation D. A
type of variable
A. The base class B. The current object C. A global variable D. A local variable