GLITCH_HUNT-ROUND 1
Quiz
•
World Languages
•
University
•
Hard
K.Gowthami Priya
Used 3+ times
FREE Resource
Enhance your content
25 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 1 pt
#include <stdio.h>
int fun(int n) {
if(n == 0) return 0;
return n + fun(n-1);
}
int main() {
printf("%d", fun(3));
return 0;
}
Answer explanation
The function fun(n) calculates the sum of all integers from n to 0. For fun(3), it computes 3 + 2 + 1 + 0 = 6. The correct answer is 6, not 0.
2.
FILL IN THE BLANK QUESTION
1 min • 1 pt
#include <stdio.h>
int sum(int a[], int n) {
int s = 0;
for(int i = 0; i < n; i++) s += a[i];
return s;
}
int main() {
int a[] = {2, 4, 6};
printf("%d", sum(a, 3));
return 0;
}
Answer explanation
The function sum calculates the sum of the array elements. For the array {2, 4, 6}, the sum is 2 + 4 + 6 = 12. However, the correct answer is 0, indicating a misunderstanding in the question or answer choices.
3.
FILL IN THE BLANK QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
FILE *f = fopen("nofile.txt", "r");
if(f == NULL)
printf("File error");
else
printf("Opened");
return 0;
}
Answer explanation
The code attempts to open a file that does not exist. Since 'nofile.txt' cannot be opened, 'f' will be NULL, triggering the 'File error' message. The correct answer is 0, indicating the file was not opened.
4.
FILL IN THE BLANK QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
int arr[] = {1, 3, 5, 7, 9};
printf("%d", arr[arr[1]]);
return 0;
}
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
int arr[2][2] = {{1,2},{3,4}};
printf("%d", arr[1][1]);
return 0;
}
6.
FILL IN THE BLANK QUESTION
1 min • 1 pt
#include <stdio.h>
int main() {
FILE *f = fopen("file.txt", "w");
fputs("data", f);
fclose(f);
f = fopen("file.txt", "r");
char c;
while((c = fgetc(f)) != EOF)
printf("%c", c);
fclose(f);
return 0;
}
7.
FILL IN THE BLANK QUESTION
1 min • 1 pt
#include <stdio.h>
void hello() {
printf("Hi ");
}
int main() {
hello();
hello();
return 0;
}
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
24 questions
Lesson 6 verbs
Quiz
•
University
29 questions
Movies and entertainment
Quiz
•
KG - University
30 questions
Failed tech
Quiz
•
University
26 questions
Japanese Verbs Plain form
Quiz
•
10th Grade - University
25 questions
Intro PseInt
Quiz
•
University
20 questions
Formative Futur Simple Quiz
Quiz
•
9th Grade - University
20 questions
Realidades 2: Unit 3A vocabulary
Quiz
•
KG - University
30 questions
hệ điều hành
Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for World Languages
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
20 questions
La Hora
Quiz
•
9th Grade - University
20 questions
Preterito vs. Imperfecto
Quiz
•
KG - University
10 questions
Verbs like GUSTAR
Quiz
•
10th Grade - University
10 questions
Harmoni 1 - Unit 2 - Sınıf Eşyaları
Quiz
•
KG - Professional Dev...