
Unit 4 : Function 2

Quiz
•
Computers
•
University
•
Medium
Norhamimi Hamdan
Used 1+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the 'main' function in a C program?
To execute loops
To define global variables
To serve as the entry point of the program
To declare functions
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to call a function named 'first'?
first{}
call first;
execute first;
first();
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax for defining a function in C?
return_type function_name(parameters) { // body }
function_name(parameters) { // body }
function_name return_type(parameters) { // body }
function_name(parameters) return_type { // body }
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between function arguments and parameters?
Arguments are always integers, parameters can be any type
There is no difference
Parameters are declared in the definition function, arguments are passed to it
Arguments are declared in the function, parameters are passed to it
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What type of variable can be accessed by all functions in a program?
Dynamic variable
Static variable
Global variable
Local variable
6.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Determine local variable?
declare outside the functions
declare inside the function body
All function can use
the variable only can be use inside the function body.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a recursive function?
A function that is defined inside another function
A function that cannot return a value
A function that calls itself
A function that calls another function
8.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output for the following programming code:
#include <stdio.h>
display(int n);
int main() {
display(3);
return 0;
}
display(int n){
printf("%d ", n);
if(n <= 1)
{
return;
}
display(n - 1);
}
1
123
321
1122
Similar Resources on Wayground
12 questions
BCA Revision u11 to 14

Quiz
•
University
12 questions
UNIT 3

Quiz
•
University
10 questions
Java Quiz 1

Quiz
•
University
10 questions
Expression in C Programming

Quiz
•
University
10 questions
CSC126_Chapter4_Part1

Quiz
•
University
10 questions
Intro to Programming Quiz

Quiz
•
University
10 questions
Topic 4 - Recursive

Quiz
•
University
10 questions
C++ Functions

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

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

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University