
C Programming

Quiz
•
Other
•
University
•
Hard
Kavinaya R
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does this code print?
char str[] = "World";
str[2] = 'r';
printf("%s", str);
World
Wrrld
Worrd
Worrld
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What happens here?
char str[] = "Hi";
str[2] = '!';
printf("%s", str);
Hi
Hi!
H!i
Undefined` or garbage value
Answer explanation
you're overwriting the null terminator — risky behavior!
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
`What does this function compute?
int fun(int n) {
if (n == 0) return 0;
return n + fun(n - 1);
}
Multiplication Table
Sum of n natural number
Factorial
Fibonacci
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does this function do?
void fun(int n) {
if (n == 0) return;
fun(n - 1);
printf("%d ", n);
}
Prints numbers in reverse
Prints from 1 to n
Infinite loop
Compilation error
Answer explanation
Recursion goes down to 0, then prints as it comes back
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this loop do?
for (int i = 1; i <= 3; i++) {
printf("Loop\n");
}
Prints “Loop” 1 time
Prints “Loop” 3 times
Infinite loop
Error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will this pattern print?
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= i; j++) {
printf("*");
}
printf("\n");
}
*** **
*
*
**
***
1
2
3
***
***
***
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does this pattern print?
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 3; j++) {
printf("%d", j);
}
printf("\n");
}
123
123
123
111
222
333
321
321
321
123
234
345
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
C++ Programming Language

Quiz
•
University
10 questions
Quiz về bài thơ Những cánh buồm

Quiz
•
6th Grade - University
15 questions
Wind

Quiz
•
University
10 questions
Quiz 2 - Taekwondo 2 MPU24051

Quiz
•
University
10 questions
c programming module 2 test

Quiz
•
University
13 questions
C Programming Concepts

Quiz
•
University
10 questions
A & R Week 7 Industry session assessment

Quiz
•
University
10 questions
Lab 2 Activity

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

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

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University