CIS 1101 Prefinal - Pointers (PART 1)

A colorful, engaging illustration depicting the concept of pointers in programming, with arrows pointing to variables, memory addresses, and code snippets related to C programming.

CIS 1101 Prefinal - Master Your Pointers

Prepare to test your knowledge of pointers and data structures in C programming with our CIS 1101 Prefinal quiz! This quiz covers essential concepts such as pointers, function arguments, and memory management.

  • Multiple choice and checkbox questions
  • Covering core topics in pointers
  • Fun and educational challenge
22 Questions6 MinutesCreated by CodingNinja725
  1. This quiz consist of two tests. Be sure to READ the directions in each test before proceeding to the questions.
  2. Answer only according to what is being asked. Take note of the case of the letters and spacing. When told to answer in numbers, answer in decimal digit form, not word form - I.e. "1" not "one".
  3. NO CHEATING - Opening of other tabs and using of any computing devices or IDEs during the test are not allowed.
  4. Backtracking is DISABLED in this quiz - make sure you place a response and review before proceeding to the next item.
  1. This quiz consist of two tests. Be sure to READ the directions in each test before proceeding to the questions.
  2. Answer only according to what is being asked. Take note of the case of the letters and spacing. When told to answer in numbers, answer in decimal digit form, not word form - I.e. "1" not "one".
  3. NO CHEATING - Opening of other tabs and using of any computing devices or IDEs during the test are not allowed.
  4. Backtracking is DISABLED in this quiz - make sure you place a response and review before proceeding to the next item.
--- Test 1: Multiple Choice (25 points) ---
Choose the best answer/s that fits the question.
For those with multiple possible answers, a right minus wrong system is implemented.
--- Test 1: Multiple Choice (25 points) ---
Choose the best answer/s that fits the question.
For those with multiple possible answers, a right minus wrong system is implemented.
1. The attributes of a variable include: (Choose all that apply) (2 points)
Name
Data type
Value
Address
Size
Range
2. The symbol * is used for (Choose all that apply) (3 points)
Dereferencing a variable being set to point to.
Getting the address of the variable.
Determining how much memory the variable being pointed to stores.
Declaring a pointer variable.
3. Which of the following argument forms can be passed to a function?
(Choose all that apply) (4 points)
Constant
Variable
Mathematical or logical expression with one or more operators
Another function with a return value
Another function without a return value
C keywords
4. Consider the function with header: void tripleInteger(int *n). Select all the correct statements below. (4 points)
The function does not have an implicit return.
The function does not have an explicit return.
The function may change the value of its actual arguments when called.
The value of the actual argument is copied internally to the function's memory space.
To call the function above with parameter x, we write "tripleInteger(int &x);".
The formal parameter is a pointer variable holding the value of the variable being passed.
5. Consider the function header void func(int *A, int B). Select all of its corresponding valid function calls below. (4 points)
int x = 10;
func(&x, 10);
func(&10, 20);
int x = 10;
int *p = &x;
func(p, x);
int x=10;
func(&x,getNum());
/*assume getNum() is a function that returns an integer */
int x = 10;
int *p = &x;
func(*p, x);
int x = 10;
int *p = &x;
func(p, *p);
6. The reason for using pointers in a C program is: (2 points)
I. Pointers allow different functions to share and modify their local variables.
II. To pass large structures so that complete copy of the structure can be avoided.
III. Pointers enable complex “linked" data structures like linked lists and binary trees.
I and II
I and III
I and III
I, II, and III
7-12. Answer the following. (6 points)
  1. The proper declaration of a pointer a pointing to an integer.
  2. Gives the memory address of integer variable a.
  3. Gives the memory address of a variable pointed to by pointer a.
  4. Gives the value stored at the address pointed to by pointer a.
  5. The proper keyword to allocate memory in C.
  6. The proper keyword to deallocate memory in C.
Int &a;
Int *a;
A
*a
&a
Sizeof(a)
Free
Calloc
Malloc
A.
B.
C.
D.
E.
F.
--- Test 2: Code Fragment Tracing (15 points) ---
Study the code fragments being presented. Answer only according to what is being asked. Note that all answers are case- and space-sensitive.
If an output is being asked and there is no output, type "NONE"; and if the fragment has a syntax error which disables it to run, type "COMPILER ERROR".
 
--- Test 2: Code Fragment Tracing (15 points) ---
Study the code fragments being presented. Answer only according to what is being asked. Note that all answers are case- and space-sensitive.
If an output is being asked and there is no output, type "NONE"; and if the fragment has a syntax error which disables it to run, type "COMPILER ERROR".
 
13. Refer to the code above.
Question 1/3: What is the value of I after execution of function f() ? (2 points)
13. Refer to the code above.
Question 2/3: What is the value of j after execution of function f() ?(2 points)
13. Refer to the code above.
Question 3/3: How many values are printed? (2 points)
14. Refer to the code above.
Question: Determine the output of the code above. (4 points)
15. Refer to the code above.
Question: Determine the output of the code above. (5 points)
{"name":"CIS 1101 Prefinal - Pointers (PART 1)", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Prepare to test your knowledge of pointers and data structures in C programming with our CIS 1101 Prefinal quiz! This quiz covers essential concepts such as pointers, function arguments, and memory management.Multiple choice and checkbox questionsCovering core topics in pointersFun and educational challenge","img":"https:/images/course6.png"}
Powered by: Quiz Maker