Test: Computer Science

1.

What is the difference between declaring a function as void and declaring it as int?

An int function needs to declare an integer variable inside the function and a void function doesn't.

A void declaration does not expect an output to that function, whereas an int function declarations expects an intger value as the output to the function.

There is no difference.

A void function has no input and an int function has at least one integer input.

A void function can have any return type whereas an int function can only have one return type.

1/2 questions

0%
Learning Tools by Varsity Tutors