One-Dimensional Array

One-Dimensional Array

10 Qs

quiz-placeholder

Similar activities

English 12 Unit 2 Vocabulary Quiz

English 12 Unit 2 Vocabulary Quiz

12th Grade

10 Qs

Циклдық алгоритм

Циклдық алгоритм

KG - University

10 Qs

Unit 7 Vocabulary

Unit 7 Vocabulary

KG - University

13 Qs

GXVZ81R7Q77W552U

GXVZ81R7Q77W552U

KG - University

9 Qs

Parcial 1-Laboratorio II-5to BACO-I Unidad Forma B

Parcial 1-Laboratorio II-5to BACO-I Unidad Forma B

KG - University

13 Qs

R1 - Python Programming - II Assignment-7

R1 - Python Programming - II Assignment-7

KG - University

9 Qs

Ardila Awang

Ardila Awang

KG - University

10 Qs

Evaluare- Bazele Programării C++

Evaluare- Bazele Programării C++

KG - University

10 Qs

One-Dimensional Array

One-Dimensional Array

Assessment

Quiz

others

Hard

Created by

SNEHA GEORGE

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?