Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions