
Mastering C: Control Structures and More
Authored by Karen Tan
Information Technology (IT)
12th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the purpose of an if statement in C?
To declare variables in C.
To create loops in C.
To define a function in C.
To execute code conditionally based on a boolean expression.
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Explain the difference between a while loop and a for loop.
A while loop is always faster than a for loop.
A for loop can only iterate over arrays, while a while loop can iterate over any data type.
A while loop requires a counter variable, while a for loop does not.
A while loop checks the condition before each iteration, while a for loop is used for a known number of iterations with initialization, condition, and increment in one line.
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
How do you declare a function in C?
return_type function_name(parameter_type1 parameter_name1, parameter_type2 parameter_name2, ...);
function_name(parameter_type1, parameter_type2);
return_type function_name(parameter_name1, parameter_name2);
function_name(parameter_type1 parameter_name1) return_type;
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the output of the following code: int a = 5; printf('%d', a++);?
6
5.0
4
5
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Describe how to access elements in an array using pointers.
Access elements using the array name directly without any pointers.
Use a pointer to the first element and pointer arithmetic to access other elements.
Use a loop to iterate through the array without pointers.
Access elements by their index only without pointers.
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is pointer arithmetic and how is it used in C?
Pointer arithmetic allows direct manipulation of string literals in C.
Pointer arithmetic is the ability to perform arithmetic operations on pointers to navigate through memory locations in C.
Pointer arithmetic is used to perform calculations on integers in C.
Pointer arithmetic is a method to allocate memory dynamically in C.
7.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
How do you pass an array to a function in C?
Use 'void functionName(dataType array[])' to pass an array.
Declare the array as 'dataType array[size]' in the function.
Pass the array by value using 'dataType array' as the parameter.
Use the syntax 'void functionName(dataType *array, int size)' to pass an 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
20 questions
ETECH 2ND QUARTER QUIZ
Quiz
•
9th - 12th Grade
15 questions
Quiz 1-15
Quiz
•
9th - 12th Grade
20 questions
Activity - Task Completion and Safety
Quiz
•
9th Grade - University
18 questions
Diagnostico Grado Sexto
Quiz
•
6th Grade - University
20 questions
1stQ Quiz 1 E-Tech
Quiz
•
12th Grade
15 questions
Test wiedzy: Tablice jednowymiarowe w C++
Quiz
•
10th Grade - University
20 questions
Python Programming 2nd Quarter Long Quiz
Quiz
•
12th Grade
22 questions
ÔN TẬP CRV1
Quiz
•
6th Grade - 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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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
Discover more resources for Information Technology (IT)
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
15 questions
Making Inferences
Quiz
•
7th - 12th Grade
12 questions
Add and Subtract Polynomials
Quiz
•
9th - 12th Grade
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
15 questions
Atomic Habits: Career Habits
Lesson
•
9th - 12th Grade
20 questions
Banking
Quiz
•
9th - 12th Grade
15 questions
Exponential Growth and Decay Word Problems Practice
Quiz
•
9th - 12th Grade
18 questions
AP Bio Insta-Review Topic 6.1*: DNA & RNA Structure
Quiz
•
9th - 12th Grade