Arrays and Pointers in C

Arrays and Pointers in C

University

15 Qs

quiz-placeholder

Similar activities

Data Warehouse - Foundations

Data Warehouse - Foundations

University

10 Qs

GIS Unit III

GIS Unit III

University

15 Qs

ICT Unit-2

ICT Unit-2

University

20 Qs

2.3.1 Graph Traversal & Path Finding Algorithms

2.3.1 Graph Traversal & Path Finding Algorithms

12th Grade - University

20 Qs

Kuis Pemrograman Dasar

Kuis Pemrograman Dasar

University

20 Qs

Robotics Prelim

Robotics Prelim

University

15 Qs

AB1401 Case Study: Facebook

AB1401 Case Study: Facebook

University

12 Qs

Digital and Analog transmission

Digital and Analog transmission

University

20 Qs

Arrays and Pointers in C

Arrays and Pointers in C

Assessment

Quiz

Computers

University

Medium

Created by

Karen Tan

Used 17+ times

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What is the syntax for declaring an array in C?

array_name = [array_size];

array_name = data_type[array_size];

array_name[array_size] = data_type;

data_type array_name[array_size];

2.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What is the syntax for declaring a pointer in C?

int ptr;

ptr = int;

int *ptr();

int *ptr;

3.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

How is pointer arithmetic performed in C?

By dividing the pointer by an integer value

By multiplying the pointer with an integer value

By adding or subtracting an integer value to/from a pointer

By performing bitwise operations on the pointer

4.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What is the difference between array and pointer in C?

Arrays are a fixed-size collection of elements, while pointers are variables that store memory addresses.

Arrays cannot be passed as arguments to functions, while pointers can

Arrays can only store integers, while pointers can store any data type

Arrays and pointers are the same thing

5.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

Explain the concept of passing an array to a function in C.

Passing an array to a function in C only allows access to the first element of the array

Passing an array to a function in C allows the function to work with the elements of the array.

Passing an array to a function in C is not possible

Passing an array to a function in C allows the function to modify the size of the array

6.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

How can you dynamically allocate memory for an array using pointers in C?

Use the 'realloc' function

Use the 'malloc' function

Use the 'free' function

Use the 'calloc' function

7.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What is the purpose of the 'const' keyword in C?

To declare a constant variable that cannot be modified

To declare a variable that can only be modified within a specific function

To declare a variable that can be modified by any function

To declare a variable that can be modified by any other variable

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?