
Array and Pointer Quiz
Quiz
•
Information Technology (IT)
•
University
•
Practice Problem
•
Medium
PRIYADHARSHNI S
Used 3+ times
FREE Resource
Enhance your content in a minute
41 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You are writing a program to store some scores in an array. You want to print the third score stored. int arr[] = {1, 2, 3, 4}; printf("%d", arr[2]); What is the output?
1
2
3
4
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You have two arrays representing sensor readings. You want to calculate the sum of the first and last values in one of these arrays. int arr[] = {5, 6, 7}; printf("%d", arr[0] + arr[2]); What is the output?
5
6
7
12
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You partially initialize an array and want to print the first and last elements of it. int arr[4] = {1}; printf("%d %d", arr[0], arr[3]); What is the output?
1 1
1 0
0 1
0 0
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a loop, you print all elements of an integer array initialized with three values. int arr[3] = {10, 20, 30}; for(int i = 0; i < 3; i++) printf("%d ", arr[i]); What does this print?
10 20 30
20 30 10
30 20 10
10 30 20
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You store characters in a char array intending it to be a string and then print it. char arr[] = {'a', 'b', 'c', '\0'}; printf("%s", arr); What does this output?
abc
a
ab
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You use pointer arithmetic to access the second element of an integer array. int arr[3] = {1, 2, 3}; printf("%d", *(arr + 1)); What is the output?
1
2
3
Garbage value
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You are confused about pointer dereferencing and arithmetic. You print *arr + 1 on an integer array. int arr[3] = {1, 2, 3}; printf("%d", *arr + 1); What is the output?
0
1
2
3
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
41 questions
UTS Konfigurasi dan Administrasi Basis Data
Quiz
•
4th Grade - University
40 questions
Kuis_03_IoT Bab 5-6
Quiz
•
University
40 questions
REMIDI SAS 8 SMT 1 INFORMATIKA
Quiz
•
8th Grade - University
40 questions
Ôn Tập Vật Lý 11
Quiz
•
11th Grade - University
39 questions
Networking Week 6
Quiz
•
3rd Grade - University
40 questions
Quiz on Search Algorithms
Quiz
•
University
40 questions
Tebak-Tebakan Lucu untuk Mahasiswa
Quiz
•
University
43 questions
SUMBER25-INFORMATIKA-KELAS7-VENY
Quiz
•
7th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
15 questions
Review1
Quiz
•
University
15 questions
Pre1
Quiz
•
University
