Part1 Array

Quiz
•
Computers
•
University
•
Easy
Abhishek Pandey
Used 4+ times
FREE Resource
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.
Similar Resources on Wayground
10 questions
Rapid Round 2

Quiz
•
University
11 questions
Recap Chapter 6, 7, 8

Quiz
•
University
10 questions
Session 9

Quiz
•
University
10 questions
Lab8_Quiz

Quiz
•
University
10 questions
C Programming Quiz-1

Quiz
•
University
10 questions
8.2 Arrays Cambridge IGCSE 0478

Quiz
•
10th Grade - University
6 questions
Array 2: Unit 8

Quiz
•
University
10 questions
RVS_Tech_quizz_even2024-25

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University