Question: 1.Which is not a proper function prototype? double doThis (); int doThis (int x); void (string doThis); void doThis (string x); 2.If a function has

1.Which is not a proper function prototype?

double doThis ();
int doThis (int x);
void (string doThis);

void doThis (string x);

2.If a function has six parameters defined, how many arguments must appear in the function call?

3.

What is wrong with the following function definition?

void square (int x)

{

return x * x;

}

void is not a valid return type
it has a return type of void and uses a return statement
the name square is not legal

nothing

4.

Once declared, a local variable

can be used anywhere in your source code
can only be used within the function body or block where it is declared
is another name for parameter

is another name for argument

5.

What is wrong with the following code?

int doSomething (int x)

{

return x;

}

int doSeomthingElse (int x)

{

string s;

int y = doSomething(s);

}

a function can only be called from the main function
y cannot be assigned the return value from doSomething
doSomething requires an integer parameter

nothing

6.

In the code below, changing the value of x in doSomething will also change the value of x in main.

int main ()

{

int x;

doSomething(x);

}

void doSomething (int x)

{

x = x + 1;

}

True
False

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!