Part1 Array

Part1 Array

University

6 Qs

quiz-placeholder

Similar activities

EXAMEN

EXAMEN

2nd Grade - University

11 Qs

PRUEBA_YOUTUBE

PRUEBA_YOUTUBE

University

10 Qs

วิทยาการคำนวณ p.5

วิทยาการคำนวณ p.5

University

10 Qs

Jaringan Dasar

Jaringan Dasar

University

10 Qs

Chapter 3 Exploring Linux Filesystems

Chapter 3 Exploring Linux Filesystems

11th Grade - University

10 Qs

Prosumers e influenciadores como ferramentas de negócios digitai

Prosumers e influenciadores como ferramentas de negócios digitai

University

11 Qs

POSPAGO 5.0

POSPAGO 5.0

University

10 Qs

conversiones de bases

conversiones de bases

University

10 Qs

Part1 Array

Part1 Array

Assessment

Quiz

Computers

University

Practice Problem

Easy

Created by

Abhishek Pandey

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

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

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to declare an array of 10 integers in C?

int arr(10);

int arr 10];

int arr[10];

array int arr[10];

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to initialize an array with values 1, 2, 3, 4, 5 in C?

a) int arr[] = {1, 2, 3, 4, 5};

b) int arr[5] = {1, 2, 3, 4, 5};

c) Both a and b

int arr[5] = (1, 2, 3, 4, 5);

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the last element in an array int arr[5] in C?

4

0

5

7

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the third element of an array arr[] in C?

arr[3];

arr[2];

arr[1];

arr(3);

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following C code?

int arr[3] = {10, 20, 30};

printf("%d", arr[1]);

10

Error

20

30

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you try to access an element outside the bounds of an array in C?

It will throw an error

It will return zero

It will access some other memory location leading to undefined behavior.

It will return a segmentation fault immediately.

Access all questions and much more by creating a free account

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

Already have an account?

Discover more resources for Computers