
One Dimensional Array

Quiz
•
Computers
•
University
•
Hard
Antony N
Used 2+ times
FREE Resource
35 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following program?
#include <stdio.h>
int main()
{
int a[3] = { 2, 5, 1 };
printf("%d", a[a[0]]);
return 0;
}
0
1
2
Compile Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output after execution of the program?
#include <stdio.h>
int main()
{
int i, a[7] = { 5, 6, 8, 2, 9, 3, 6 }, result;
result = a[0];
for (i = 1; i < 7; i++)
{
if (result > a[i])
continue;
result = a[i];
}
printf("%d", result);
return 0;
}
8
2
9
Compiler error because of two six in the array.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following C program?
#include <stdio.h>
int main()
{
int arr[4] = { 1, 2, 3, 4, 5 };
printf("%d", arr[0]);
return 0;
}
1
2
No Output
Compilation Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output of the following C program:
#include <stdio.h>
int main()
{
int a;
int arr[5] = { 1, 2, 3, 4, 5 };
arr[0] = ++arr[1] - arr[1]--;
a = arr[0]++;
arr[0] = ++arr[a++];
printf("%d,%d,%d", a, arr[0], arr[1]);
return 0;
}
1,2,3
1,2,2
2,2,2
2,3,3
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be output?
#include <stdio.h>
int main()
{
int i;
int arr[3] = { 1 };
for (i = 0; i < 3; i++)
printf("%d ", arr[i]);
return 0;
}
1 followed by garbage values
1 1 1
1 0 0
Syntax error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Predict the output of the following code.
#include <stdio.h>
int main()
{
int arr[1] = { 5 };
printf("%d", 0[arr]);
return 0;
}
0
1
5
Syntax error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the output?
#include <stdio.h>
int main()
{
int arr1[] = { 1, 2, 3 };
int arr2[] = { 4, 5, 6 };
int arr3[];
arr3[] = arr1[] + arr2[];
printf("%d", arr3[]);
return 0;
}
1,2,3
5,6,7
5,7,9
Error
Create a free account and access millions of resources
Similar Resources on Wayground
30 questions
OODP FT1 Assessment Questions

Quiz
•
University
30 questions
C Language MCQs

Quiz
•
University
40 questions
Trivia(Explore in depth)

Quiz
•
University
40 questions
Playing Code!

Quiz
•
University
30 questions
OODP - AM1 - FT1 - 04.02.2025

Quiz
•
University
30 questions
Computer Programming 2

Quiz
•
University
35 questions
Mock Test

Quiz
•
University
30 questions
FT-1 P2

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

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

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University