One-Dimensional Array

One-Dimensional Array

10 Qs

quiz-placeholder

Similar activities

Prueba de Conocimientos 3

Prueba de Conocimientos 3

12th Grade

10 Qs

GD: Unit 4

GD: Unit 4

9th - 12th Grade

8 Qs

A Level Further Maths Core Pure Year 2 Chapter 3: Mini test

A Level Further Maths Core Pure Year 2 Chapter 3: Mini test

KG - University

5 Qs

Graph and Tree Traversal

Graph and Tree Traversal

KG - University

15 Qs

Grade 10 Computer Application String Handling

Grade 10 Computer Application String Handling

KG - University

10 Qs

Parcial I - I Serie- Programación I - 4to BACO - I Unidad

Parcial I - I Serie- Programación I - 4to BACO - I Unidad

KG - University

15 Qs

L1 Python Recall - Do Now

L1 Python Recall - Do Now

KG - University

8 Qs

Java Refresher

Java Refresher

KG - University

11 Qs

One-Dimensional Array

One-Dimensional Array

Assessment

Quiz

others

Medium

Created by

SNEHA GEORGE

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. What is the correct way to declare a one-dimensional array in C?
A) int arr[10];
B) int arr();
C) array int arr[10];
D) int arr[10] = (0);

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. What will be the output of the following code? int arr[5] = {10, 20, 30, 40, 50}; printf("%d", arr[2]);
A) 10
B) 20
C) 30
Option 4
D) 50

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. What is the index of the last element in an array declared as int marks[6];?
A) 6
B) 5
C) 0
D) 1

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. Identify the error in the following code: int a[3]; a[0] = 5; a[1] = 10; a[3] = 15;
A) No error
B) a[3] is out of bounds
C) Missing return type
D) Array not initialized

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. What will be the output of this code? int arr[4] = {1, 2}; printf("%d %d %d %d", arr[0], arr[1], arr[2], arr[3]);
A) 1 2 0 0
B) 1 2 garbage garbage
C) 1 2 3 4
D) Compile time error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. Which of the following best describes an array in C?
A) A dynamic collection of variables of different data types
B) A pointer to a string
C) A collection of variables of the same data type
D) A single variable storing a string

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. What will be the output? int arr[3] = {2, 4, 6}; arr[1] = arr[1] + arr[2]; printf("%d", arr[1]);
A) 10
B) 6
C) 8
D) 12

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?