
C Programming Pointers Quiz
Quiz
•
Engineering
•
12th Grade
•
Practice Problem
•
Medium
Manikandan AVM
Used 3+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
What is a pointer in C?
A variable that stores the address of another variable.
A variable that stores data.
A keyword in C.
None of the above.
Answer explanation
A pointer in C is specifically defined as a variable that holds the address of another variable, allowing for direct memory access and manipulation. This makes the first choice the correct answer.
2.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Which operator is used to get the value at the address stored in a pointer variable?
&
*
%
$
Answer explanation
The '*' operator is used to dereference a pointer, allowing you to access the value stored at the address contained in the pointer variable. Therefore, the correct answer is '*', not '&', '%', or '$'.
3.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
What is the output of the following code? int x = 10; int *p = &x; printf("%d", *p);
10
Address of x
Garbage value
Compiler error
Answer explanation
The code initializes an integer x with 10 and a pointer p that points to x. The printf statement dereferences p, accessing the value of x, which is 10. Therefore, the output is 10.
4.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Which of the following is the correct way to declare a pointer to an integer?
int p;
int *p;
int &p;
int ptr;
Answer explanation
The correct way to declare a pointer to an integer is 'int *p;'. This syntax indicates that 'p' is a pointer variable that can hold the address of an integer. The other options do not correctly declare a pointer.
5.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
What will be the output of the following code? int x = 5; int *p = &x; *p = 20; printf("%d", x);
5
20
Address of x
Compiler error
Answer explanation
The code initializes x to 5, then uses a pointer p to change the value of x to 20. The printf statement outputs the current value of x, which is now 20. Therefore, the correct answer is 20.
6.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Which of the following statements is true about pointers?
Pointers can be used to access array elements.
Pointers cannot be used with functions.
Pointers are not allowed in C.
Pointers can only point to integer variables.
Answer explanation
The correct statement is that pointers can be used to access array elements. Pointers are versatile in C, allowing access to arrays, functions, and various data types, not just integers.
7.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
What is the output of the following code? int arr[] = {10, 20, 30}; int *p = arr; printf("%d", *(p + 1));
10
20
30
Compiler error
Answer explanation
The pointer 'p' points to the first element of 'arr'. The expression '(p + 1)' accesses the second element of the array, which is '20'. Thus, the output of the code is '20'.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
19 questions
Chapter 2: Photovoltaic System Installation Safety Quiz
Quiz
•
12th Grade
16 questions
VEX EXP Bucky Basketball - T
Quiz
•
9th Grade - University
15 questions
Lean Manufacturing and Waste Reduction Quiz
Quiz
•
12th Grade - University
15 questions
2025 Wolf Domestication
Quiz
•
7th Grade - University
20 questions
Engineering Technology Foundations Sample
Quiz
•
9th - 12th Grade
19 questions
Traditional Woodworking Hand Tools Quiz
Quiz
•
9th - 12th Grade
15 questions
Stream Flow Measurement Quiz
Quiz
•
12th Grade - University
15 questions
Reverse Engineering Quiz
Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Engineering
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
34 questions
Geometric Terms
Quiz
•
9th - 12th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
16 questions
Proportional Relationships And Constant Of Proportionality
Quiz
•
7th - 12th Grade
10 questions
DNA Replication Concepts and Mechanisms
Interactive video
•
7th - 12th Grade
10 questions
Unit 2: LS.Bio.1.5-LS.Bio.2.2 Power Vocab
Quiz
•
9th - 12th Grade
20 questions
Food Chains and Food Webs
Quiz
•
7th - 12th Grade
15 questions
Identify Triangle Congruence Criteria
Quiz
•
9th - 12th Grade
