Function and Procedure in C

Quiz
•
Computers
•
University
•
Medium
EMMANUEL ADETYA
Used 1+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main difference between a procedure and a function in C?
A function returns a value, while a procedure does not.
A function can be called recursively, while a procedure cannot.
A function modifies the input parameters, while a procedure does not.
A function can have multiple return statements, while a procedure cannot.
Answer explanation
A function returns a value, while a procedure does not.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can a procedure return a value in C?
No
Yes
Maybe
Sometimes
Answer explanation
In C, when you declare a function as a procedure (void function), it doesn't return any value explicitly using the return statement. Instead, it simply performs a task or a series of tasks without returning a result.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can a function call another function in C?
Rarely
Sometimes
Yes
No
Answer explanation
Yes, a function can call another function in C. This is a common practice in programming to divide tasks into smaller, reusable functions for better organization and readability.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Do procedures have a return type in C?
Sometimes
Only in certain cases
No
Yes
Answer explanation
Procedures in C do not have a return type, so the correct answer is 'No'.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the two, function or procedure, is more commonly used in C programming?
Procedure
Both
Neither of them
Function
Answer explanation
Functions are more commonly used in C programming compared to procedures. Functions allow for code reusability and modularity, making them a preferred choice in C programming.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In terms of reusability, which is more beneficial - functions or procedures?
Neither of them
Both of them
Procedures
Functions
Answer explanation
Functions are more beneficial in terms of reusability compared to procedures because functions can be called multiple times with different inputs, making them versatile and reusable in various parts of a program.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary purpose of a function in C programming?
To encapsulate a set of instructions that can be reused multiple times.
To make the code more complex
To slow down the program execution
To confuse other programmers
Answer explanation
The primary purpose of a function in C programming is to encapsulate a set of instructions that can be reused multiple times.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Object Oriented Programming Quiz

Quiz
•
University
10 questions
Topic 4 - Recursive

Quiz
•
University
8 questions
Unit 1 - Structure of C

Quiz
•
University
15 questions
Visual Basic

Quiz
•
University
11 questions
Fundamentals of Algorithm Test 2

Quiz
•
University
10 questions
C++ Functions

Quiz
•
University
12 questions
UNIT 3

Quiz
•
University
12 questions
BCA Revision u11 to 14

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