
FCPC-MidtermExam-DSA

Quiz
•
Information Technology (IT)
•
University
•
Medium
ALVIN CERTEZA
Used 5+ times
FREE Resource
70 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct syntax for a while loop in C?
while (condition) { statement; }
while condition { statement; }
while (statement) { condition; }
while [condition] { statement; }
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code? int i = 0; while(i < 5) { printf("%d", i); i++; }
12345
01234
1 2 3 4 5
5
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following loops will always execute at least once?
for
while
do-while
All loops can execute at least once
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program? int i; for(i = 1; i <= 3; i++) { printf("%d ", i); }
1 2 3
0 1 2
1 2 3 4
3 2 1
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct syntax for a do-while loop?
do { statement; } while (condition);
do statement while (condition);
while (condition) do { statement; };
do statement until (condition);
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the correct way to declare a function that returns an integer in C?
function int() {}
int function() {}
int function {}
int function(void) {}
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is true about the function prototype in C?
It is required for all functions.
It must be placed before the function definition.
It can be omitted if the function definition is provided before the function call.
It must include the function body.
Create a free account and access millions of resources
Similar Resources on Wayground
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 Information Technology (IT)
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