Search Header Logo

CSC126_Quiz7: Chapter 5.1

Authored by TS ZAKARIA

Computers

University

CSC126_Quiz7: Chapter 5.1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a function in programming?

A type of variable

A block of code designed to perform a specific task

A data structure

A library of predefined functions

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a characteristic of user-defined functions?

They are predefined in libraries

They are written by the programmer

They cannot return values

They are always void functions

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a function prototype?

To call the function

To execute the function immediately

To declare the function's name, return type, and parameters

To define the body of the function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the 'setprecision' function do?

Copies one string to another

Controls the number of digits displayed for floating-point numbers

Compares two strings character by character

Sets the width of the output field

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C++, what is the difference between actual and formal parameters?

Actual parameters are passed during function definition, formal parameters are used in function calls

Actual parameters are always integers, formal parameters can be any type

Formal parameters are passed during function definition, actual parameters are used in function calls

Both are the same

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the return type of a void function?

It can return multiple values

It returns a string

It does not return a value

It returns a value

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which header file is used for mathematical functions in C++?

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?