
DSA-Quiz1-Pointers
Authored by Anusha T
Information Technology (IT)
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the primary purpose of a pointer in C?
To declare a new data type
To perform arithmetic operations on numbers
To store integer values
To store the memory address of another variable
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which operator is used to get the memory address of a variable?
. (dot operator)
& (address-of operator)
* (dereference operator)
-> (member access operator)
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
If `int *ptr;` is declared, what type of value can `ptr` store?
Address of a floating-point variable
An integer value
The memory address of an integer variable
A floating-point value
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following C code snippet?
int x = 10;
int p = &x;
printf("%d", *p);
The memory address of x
Error
Garbage value
10
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following statements correctly initializes a pointer `ptr` to point to an integer variable `num`?
ptr = *num;
int *ptr = #
int ptr = num;
int *ptr = num;
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the value of `p` after the following operations and `int` takes 4 bytes?
int arr[] = {10, 20, 30, 40, 50}; int *p = arr; p = p + 2;
The address of `arr[2]`
The address of `arr[1]`
The value `30`
The address of `arr[0]` + 2 bytes
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
char str[] = "Hello"; char *ptr = str; What is the value of *(ptr + 2)?
The memory address of 'l'
e
H
l
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
14 questions
Quiz 1
Quiz
•
University
13 questions
Session 15 + 16 : Function
Quiz
•
University
12 questions
Aula07 - Matrizes
Quiz
•
University
15 questions
Huawei Security
Quiz
•
University
15 questions
Desarrollo Web Integral Examen 3 Parcial - Remedial
Quiz
•
University
10 questions
Abstracciones procedimentales
Quiz
•
University
10 questions
Jaringan Komputer dan Internet
Quiz
•
9th Grade - University
5 questions
SQL Database Quiz
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Information Technology (IT)
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
5 questions
Helping Build the Internet: Valerie Thomas | Great Minds
Interactive video
•
11th Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
19 questions
Review2-TEACHER
Quiz
•
University
15 questions
Pre2_STUDENT
Quiz
•
University
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University