
Unit 13 Function and decision
Authored by Abhishek Pandey
Computers
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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[]);
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
10 questions
Algoritmikë
Quiz
•
University
10 questions
System System
Quiz
•
10th Grade - University
11 questions
11 câu trắc nghiệm PHP
Quiz
•
University
10 questions
pointers and structures
Quiz
•
University
10 questions
Third Year Placement Training Revision Test
Quiz
•
University
10 questions
Teste python- Unesp-Jaboticabal
Quiz
•
University
10 questions
Diode Quiz
Quiz
•
University
10 questions
Seatwork HASH (Data Structure)
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade