
Array - Recap

Quiz
•
Information Technology (IT)
•
University
•
Hard
Divina 2908
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How do you initialize an array in C?
a) int arr[3] = (1,2,3);
b) int arr(3) = {1,2,3};
c) int arr[3] = {1,2,3};
d) int arr(3) = (1,2,3);
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What are the different ways to initialize an array with all elements as zero?
a) int array[5] = {};
b) int array[5] = {0};
c)int a = 0, b = 0, c = 0;
int array[5] = {a, b, c};
d) All of the mentioned
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
. What are the elements present in the array of the following C code?
int array[5] = {5};
a)5, 5, 5, 5, 5
b) 5, 0, 0, 0, 0
c) 5, (garbage), (garbage), (garbage), (garbage)
d) (garbage), (garbage), (garbage), (garbage), 5
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following C statements will calculate the correct size of an array of 10 integers?
(Assuming the declaration as int a[10];)
a) sizeof(a[10]);
b) sizeof(*a);
c) sizeof(a);
d) sizeof(&a);
5.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the index of the last element in an array of size n in C?
n
n+1
n-1
0
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
#include <stdio.h>
int main() {
int arr[] = {10, 20, 30, 40, 50};
printf("%d", *(arr + 2));
return 0;
}
10
30
50
20
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not valid for accessing an array element?
arr[i]
*(arr + i)
i[arr]
arr * i
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Understanding Loops in C Programming

Quiz
•
1st Grade - University
15 questions
Session 12 + 13 + 14: Searching and Sorting Algorithms

Quiz
•
University
10 questions
Quiz Meet 1 Mini SC Programing

Quiz
•
University
10 questions
PRF192

Quiz
•
University
15 questions
Bài 26

Quiz
•
10th Grade - University
10 questions
Java Quiz (Basics)

Quiz
•
University
10 questions
5. TRANSMISION DE DATOS NIVEL DE TRANSPORTE

Quiz
•
University
11 questions
массивы

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Information Technology (IT)
15 questions
Disney Trivia

Quiz
•
University
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University
20 questions
Disney Trivia

Quiz
•
University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
5 questions
Examining Theme

Interactive video
•
4th Grade - University
23 questions
Lab 4: Quizziz Questions

Quiz
•
University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University