
C Arrays Quiz

Quiz
•
Information Technology (IT)
•
University
•
Hard
PRIYADHARSHNI S
Used 1+ times
FREE Resource
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly declares an array of 10 integers in C?
int arr;
array arr;
int arr;
int arr[];
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the index of the first element in a C array?
0
1
-1
n (array size)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you initialize all elements of an integer array arr to zero?
int arr = {0};
int arr = (0,0,0,0,0);
int arr;
int arr; arr=0;
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will happen if you access arr in an array declared as int arr;?
It will access last element
Compile-time error
Unpredictable (undefined behavior)
Produces zero output
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these accesses the fifth element in the array arr?
arr
arr(5)
arr{5}
arr
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? c int arr[4] = {1,2,3,4}; printf("%d", arr[2]);
2
3
4
1
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If you declare int arr = {5}; what are the values in arr?
5, 5, 5
0, 0, 0
5, 0, 0
All garbage values
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
Java қазақша 101 - 150

Quiz
•
University
50 questions
Data Structures Quiz

Quiz
•
University
50 questions
" C Proficiency "

Quiz
•
University
50 questions
HTML, CSS, and JavaScript Quiz

Quiz
•
University
45 questions
Algorithm Design and Analysis Quiz

Quiz
•
University
50 questions
Kuis Pemrograman Python

Quiz
•
University
50 questions
ReactJS Quiz 1

Quiz
•
University
50 questions
тест3

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade