It states that the function is a non-returning value function
2
New cards
cmath
In order to use the sqrt function, we must include the \_________ library
3
New cards
int
Check the given code:
int add(int a,int b)
{
int add;
add \= a + b;
return add;
}
What would be the returning value data type?
4
New cards
void
Complete the code:
`#include `
`using namespace std;`
`// Print grade for the score `
`_______ printGrade(double score) { `
` if (score >= 90.0) `
` cout << 'A'; `
` else if (score >= 80.0) `
` cout << 'B'; `
` else if (score >= 70.0) `
` cout << 'C'; `
` else if (score >= 60.0) `
` cout << 'D'; `
` else cout << 'F'; }`
\ `int main() { `
` cout << "Enter a score: "; `
` double score; `
` cin >> score;`
` cout << "The grade is "; `
` printGrade(score);`
` return 0; `
`}`
5
New cards
Parameter
It refers to the information that can be passed to a function
6
New cards
function name and return type
What are the mandatory parts of a function declaration?
7
New cards
Two or more functions with the same name but different number of parameters or type
Overloaded functions are:
8
New cards
Local
A type of variable inside a function
9
New cards
Parameter
A placeholder of values passed into a function.
10
New cards
Type and number of Arguments
Which of the following permits function overloading in C++?
11
New cards
Overloaded Function
Two or more functions having the same name but different argument(s) are known as:
12
New cards
void function
The function that returns no value is known as
13
New cards
1
How many minimum numbers of functions need to be present in a C++ program?
14
New cards
colon :
Which of the following is NOT included in a function declaration?
15
New cards
3
How many parameters are there in the function:
int theArea(int a,int b, int c)?
16
New cards
rand()
nasa
Which of the following functions does NOT use the cmath library?
17
New cards
pow
Which of the following computes for the power of a given number?
18
New cards
int
What is the return type of the function with the prototype :
int functionx (char x, char y) ;
19
New cards
declaration
The int max (int num1, int num2); code is a function \_________________ :
20
New cards
function name and return type
In C++, which of the following is important in a function?
21
New cards
int
What word is missing below (fill in the blanks). Write a function declaration called increaseTemperature which takes 2 integers as formal parameters. The two parameters represent the upper and lower The function returns the difference between the upper and lower targets as an integer.
\______ increaseTemperature(int upper, int lower)
{
return upper - lower;
}
22
New cards
To the rightmost side of the parameter list
Where should default parameters appear in a function prototype?
23
New cards
argument
When a parameter is passed to a function, it is called \______________.
24
New cards
error
walang ;
What is the output of the given program?
\#include < iostream \>
using namespace std;
void mani()
void mani()
{
cout << "hello";
}
int main()
{
mani();
return 0;
}
25
New cards
5
What is the output of the program?
\#include
26
New cards
parameter
It refers to the information that can be passed to a function
27
New cards
same function name but different number of arguments
When will we use the function overloading?
28
New cards
error
What is the output of the following code?
\#include
29
New cards
50
What is the value that is returned in the following function?
int getVolume() {
int v;
v \= 23;
if (v < 50) {
return 50;
}
return v;
}
30
New cards
void myGrade1(int x, int y)
Which of the following has 2 parameters?
31
New cards
invoked
To execute the codes of function, the user-defined function needs to be \__________.
32
New cards
abs
In order to define the absolute value of a number we should use:
33
New cards
default value
If the user didn't supply the user value means, then what value will the function take?
34
New cards
\=
What symbol is used to set a default parameter value?
35
New cards
int foo(int x, int y \=5, int z\=10)
Which of the following function declaration using the default argument is correct?
36
New cards
it will not return a value to its caller
What will happen when we use a void in argument passing?
37
New cards
floor
Which of the following function gets the floor of a number?
38
New cards
error??
What is the default argument of b in the function?
int sum(int a\=10, int b, int c\=30);
39
New cards
startCall(4432, 3);
To call the function startCall() with the number 4432 and 3, what would you write in the main() function?
40
New cards
1hi
What is the output for the given program?
\#include
41
New cards
void
What will you use if you do NOT intended to return value?
42
New cards
functCall();
Which of the following is a valid function call (assuming the function exists)?
43
New cards
functions are overloaded
In a program you saw the following:
int myFunctionTools(int x)
float myFunctionTools(float x)
double myFunctionTools(double x, double y)
What's the best description of the given functions?
44
New cards
local
A type of variable inside a function
45
New cards
parameter
A placeholder of values passed into a function.
46
New cards
12
What is the output of the following code?
\#include
47
New cards
default value
If the user didn't supply a value in a function, then what value will it take?
48
New cards
name
A function can be called from another function using its \____________
49
New cards
changes to the parameter values within the function also affects the original arguments
What are the advantages of passing arguments by reference?
50
New cards
int
In the following declaration, what is the return type?
int myMethod(int count, double value)
{
return 4;
}
51
New cards
20
What is the output of the following code?
\#include
52
New cards
Factorial is \= 24
What would be the output of the given program?
\#include
53
New cards
all of mentioned
In C++, which of the following is TRUE? Group of answer choices
All of the mentioned
Function can have no argument but return value
Function can have no argument but no return value
Functions can have no argument and no value
54
New cards
Return Type
It is the data type of the value the function returns.
55
New cards
Function name
It is the actual name of the function
56
New cards
int
In the following declaration, what is the return type?
int myMethod(int count, double value)
{
return 4;
}
57
New cards
Arguments are passed but it has no returning value
In the function void primeNumber (int n); which of the following is NOT true?
58
New cards
function declaration
In C++, the function prototype is also known as \_________________________
59
New cards
double
What is the return value of the following function: double myRewards(double x, double y)?
60
New cards
cmath
In order to use the round function, we must include the \_________ library
61
New cards
When a function is declared
When do we define the default values for a function?
62
New cards
caller function
Where does the "return statement" return the execution of the program?
63
New cards
User value
Which value will it take when both user and default values are given?
64
New cards
D
To call the function startCall() with the number 4432 and 3, what would you write in the main() function?
a. startCalls(4432,2);
b. StartCall(4432, 3)
c. startcall(4432,3);
d. startCall(4432, 3);
65
New cards
void funct();
Which of the following is NOT a proper function prototype (definition)?
66
New cards
ceil
Which of the following function gets the ceiling of a number?
67
New cards
parenthesis
In C++, arguments to functions always appear within \______________.
68
New cards
main function
Where does the execution of the program starts?
69
New cards
getScore()
Which of the following is NOT a built-in function?
70
New cards
default arguments
the default argument must be followed by default arguments only.
If we start our function call with default arguments, then what will be the proceeding arguments?
71
New cards
double myGrade (double p, double q)
Which of the following does return a precision number?
72
New cards
return
In order to return a value from a function you must use:
73
New cards
char myGrade(int x)
Which of the following does return a character?
74
New cards
10
What is the output of the program?
\#include < iostream \>
using namespace std;
void fun(int x, int y)
{
x \= 20;
y \= 10;
}
int main()
{
int x \= 10;
fun(x, x);
cout << x;
return 0;
}
75
New cards
return
A function can return a value by calling using the keyword \_____________
76
New cards
sqrt
Which of the following computes for the square root of a number?
77
New cards
semicolon
What symbol is used to end a function declaration?
78
New cards
2
How many parameters are there in the function: int add(int a,int b)?
79
New cards
functions
In C++, \________________ are the building blocks of C++ programs
80
New cards
int
What is the return type of the function with the prototype :
int functionx (char x, char y) ;
81
New cards
1
What is the output of the following code?
\#include
82
New cards
TheSum
Which of the following is NOT a built-in function?
83
New cards
pass by value pass by reference pass by pointer
In C++, variables can be passed to a function by:
84
New cards
rightmost
Where does the default parameter can be placed by the user?
85
New cards
Call by value and call by reference
Which if the following is a way to pass an argument in C++?
86
New cards
10
What is the output of the program?
\#include < iostream \>
using namespace std;
void fun(int x, int y)
{
x \= 20;
y \= 10;
}
int main()
{
int x \= 10;
fun(x, x);
cout << x;
return 0;
}
87
New cards
int
What is the return type of the function with the prototype :
int functionx (char x, char y) ;
88
New cards
void function
A function with no return value is \_______________.
89
New cards
no output
What is the default argument of b in the function?
int sum(int a\=10, int b, int c\=30);
90
New cards
int myRoundedGrade(int x)
Which of the following returns an integer?
91
New cards
abs
Which of the following computes for the absolute value for int?
92
New cards
float
The return type of the function float divide (float a, float b)) is :
93
New cards
1
What is the output of the following code?
\#include
94
New cards
overloaded
When two functions with the same name are defined in the same scope, the function is:
95
New cards
int functCall (int x) {return x \= x+1;}
Which of the following is a complete function?
96
New cards
built-in
Library functions are also known as \_______ function:
97
New cards
Factorial is \= 24
What would be the output of the given program?
\#include
98
New cards
func(int x)
Which of the following is NOT a proper function prototype (definition)?
99
New cards
cin
Which of the following function is used to accept user inputs?