
Exploring 1D Array Loops
Authored by Bhawna Suri
Computers
University
Used 7+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is a 1D array?
A 1D array is a linear collection of elements accessed by a single index.
A 1D array requires multiple indices to access elements.
A 1D array can only store integers.
A 1D array is a two-dimensional structure.
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Write a loop to print all elements of a 1D array of length N in C
int i = 1;
while( i <N) { printf("%d\n",array[i]); }
int i = 0;
while(i < N) { printf("%d",array[i++]); }
for(int i = 0; i < N; i++ ) { printf("%d\n",array[i]); }
for(int i = 0; i <= N; i++ ) { printf("%d\n",array[i]); }
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How can you find the length of a 1D array in C?
length = sizeof(array) / sizeof(array[0])
length = count(array)
length = array.length()
length = sizeof(array)
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following code snippet: int arr[] = {1, 2, 3}; for(int i=0; i<3; i++) { printf("%d ", arr[i]); }?
1 2 3
3 2 1
1 2
2 3 4
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
void checkEvenOrNot(int num)
{
if (num % 2 == 0)
goto even;
else
goto odd;
even:
printf("%d is even", num); return;
odd:
printf("%d is odd", num); }
int main()
{
int num = -2;
checkEvenOrNot(num);
return 0;
}
Output
error
-2 is even
-2 is odd
none of the above
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
10 questions
INTRODUCCION A LA PROGRAMACION
Quiz
•
6th Grade - University
10 questions
Hyrje në SO
Quiz
•
University
10 questions
2025 python class first quiz
Quiz
•
9th Grade - University
10 questions
Let's Play Together
Quiz
•
University - Professi...
10 questions
Gestão de TI - Estratégias Comp Genéricas
Quiz
•
University
10 questions
ENGENHARIA DE SOFTWARE
Quiz
•
University
10 questions
T02: Python - The Basics
Quiz
•
University
10 questions
Clustering_Pertemuan2_Quiz_Ceria
Quiz
•
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