Test: Computer Science


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 function can have any return type whereas an int function can only have one return type.

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.

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

There is no difference.

1/2 questions


Access results and powerful study features!

Take 15 seconds to create an account.
Start now! Create your free account and get access to features like:
  • Full length diagnostic tests
  • Invite your friends
  • Access hundreds of practice tests
  • Monitor your progress over time
  • Manage your tests and results
  • Monitor the progress of your class & students
By clicking Create Account you agree that you are at least 13 years old and you agree to the Varsity Tutors LLC Terms of Use and Privacy Policy.
Learning Tools by Varsity Tutors