
TQ-Array operations on functions

Quiz
•
Computers
•
University
•
Hard
KarunaiMuthu SriRam
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1
2
3
Compiler Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
#include <stdio.h>
void modify(int arr[]) {
arr[1] = 5;
}
int main() {
int a[] = {1, 2, 3};
modify(a);
printf("%d", a[1]);
return 0;
}
1
2
3
5
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
#include <stdio.h>
void change(int *arr) {
arr[2] = 10;
}
int main() {
int a[] = {1, 2, 3};
change(a);
printf("%d", a[2]);
return 0;
}
1
2
3
10
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
#include <stdio.h>
void update(int *a) {
a++;
*a = 7;
}
int main() {
int arr[] = {3, 4, 5};
update(arr);
printf("%d", arr[1]);
return 0;
}
3
4
7
Undefined
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
#include <stdio.h>
void process(int *arr) {
arr[0] = 6;
}
int main() {
int a[] = {4, 5, 6};
process(a);
printf("%d", a[0]);
return 0;
}
4
5
6
Compiler Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
#include <stdio.h>
void arrayFunc(int arr[]) {
arr[0] = 8;
}
int main() {
int a[] = {2, 3, 4};
arrayFunc(a);
printf("%d", a[0]);
return 0;
}
2
3
4
8
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
#include <stdio.h>
void modifyArray(int *arr) {
arr++;
*arr = 9;
}
int main() {
int a[] = {5, 6, 7};
modifyArray(a);
printf("%d", a[1]);
return 0;
}
5
6
7
9
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
1st Year quiz

Quiz
•
University
15 questions
Common errors in C programming

Quiz
•
University
20 questions
C - Strings

Quiz
•
University
15 questions
Bootcamp Day 3 - Java Array

Quiz
•
University
20 questions
GirlsWhoML Workshop 0

Quiz
•
University
18 questions
C Pointers

Quiz
•
University
23 questions
C que que que

Quiz
•
University
20 questions
PRA UAS - Dasar Dasar Pemrograman 2023

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University