Unit 13 Function and decision

Quiz
•
Computers
•
University
•
Easy
Abhishek Pandey
Used 2+ times
FREE Resource
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
void checkNumber(int x) {
if (x > 0) {
printf("Positive");
} else if (x == 0) {
printf("Zero");
} else {
printf("Negative");
}
}
int main() {
checkNumber(0);
return 0;
}
Zero
One
Negative
positive
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following decision structures is best suited for checking multiple conditions in a compact way?
if-else
switch
while
for
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
void checkValue(int x) {
if (x > 50) {
printf("Greater than 50");
} else if (x == 50) {
printf("Equal to 50");
} else {
printf("Less than 50");
}
}
int main() {
checkValue(100);
return 0;
}
Greater than 50
Equal to 50
Less than 50
x==50
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which loop is guaranteed to execute at least once, even if the condition is false?
for loop
while loop
do-while loop
if loop
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to define a function in C?
function(int a, int b) { return a + b; }
int function(a, b) { return a + b;
int function(int a, int b) { return a + b; }
int function(int, int) { return a + b; }
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to pass an array to a function in C?
function(array[]);
function(array[10]);
function(array);
function(int array[]);
Similar Resources on Wayground
10 questions
Programming for Problem Solving

Quiz
•
University
7 questions
Java arrays

Quiz
•
University
10 questions
C++ Array Quiz

Quiz
•
University
10 questions
Basic C Knowledge Exercise

Quiz
•
University
10 questions
unidad4

Quiz
•
University
10 questions
Java Basics

Quiz
•
University
10 questions
Struktur Data

Quiz
•
University
11 questions
Java Quiz 3 - Array

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