Write appropriate C++ statement/s for each of the given conditions below.
1.
A
function call
that passes the value of
x
. The function is named as
getNumber
.
2.
A
function call
that passes the values of two parameters
x
and
y
. The function is named
as
computeArea
.
3.
A
function heading
named
minimum
with two integer parameters called
n1
and
n2
and
returns an integer result.
4.
A
function heading
of void function named as
computeP
erimeter
with two integer
parameters called
p1
and
p2
.
5.
A
void function
named as
check
with one formal parameter of type integer, that will
determine if the value
received in the parameter is positive or negative.
// #1
getNumber(x);
// #2
computerArea(x, y);
// #3
int minimum(int n1, n2);
// #4
void computePerimeter(int p1, int p2);
// #5
void check(int value) {
if (value >= 0)
std::cout << "positive";
else
std::cout << "negative";
}
Comments
Leave a comment