DSA-Quiz1-Pointers

DSA-Quiz1-Pointers

University

10 Qs

quiz-placeholder

Similar activities

Ulangkaji PB (Ujian 1) Set B

Ulangkaji PB (Ujian 1) Set B

University

10 Qs

Eval. 3B Bloque 1

Eval. 3B Bloque 1

9th Grade - University

15 Qs

CLC Lesson 4&5 Quiz

CLC Lesson 4&5 Quiz

University

12 Qs

Java_Quiz_Part_2

Java_Quiz_Part_2

University

12 Qs

Online Privacy Awareness Quiz

Online Privacy Awareness Quiz

7th Grade - University

13 Qs

Python_MCQ_2

Python_MCQ_2

University

15 Qs

Test

Test

University

15 Qs

Examen 2 Conceptos

Examen 2 Conceptos

University

10 Qs

DSA-Quiz1-Pointers

DSA-Quiz1-Pointers

Assessment

Quiz

Information Technology (IT)

University

Medium

Created by

Anusha T

Used 1+ times

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?